BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-05-2008, 12:37 PM   #1
mateo666
New Member
 
Join Date: May 2008
Model: 8830
PIN: N/A
Carrier: bell
Posts: 11
Default Newby question

Please Login to Remove!

I'm developping a mobile web site that will be accessible by blackberry devices with a built in gps receiver and i'm having some problem with some javascript i think... here is one of my page
Code:
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <% if( ( TempData["ErrorMsg"] ?? ViewData.ErrorMsg ) != null ){ %>
    <p class="error">
        <% =TempData["ErrorMsg"] ?? ViewData.ErrorMsg %></p>
    <% } %>
    
    <%using (Html.Form<PunchController>(p => p.GetNextView(Guid.NewGuid()), FormMethod.Post, new { _id = "formindex" }))
      { %>
    <%=string.Format(GTSResources.GetLocalizedText("CurrentStateMsg"), ViewData.CurrentState)%>
    <br />
    <br />
    <%=GTSResources.GetLocalizedText("CurrentStateChoiceMsg")%>
    <%=Html.Select("DesiredState", ViewData.PossibleStateTransition)%>
    <%=Html.Hidden("GpsCoordinate", null)%>
    <%=Html.Hidden("PreviousPage", "Index")%>
    <br />
    <br />
    <%=Html.SubmitButton("submit", GTSResources.GetLocalizedText("SubmitBtnText"), new { _onclick = "SetGps();"})%>
    <%} %>

    <script type="text/javascript">
    function SetGps()
    {
        if(blackberry.location.GPSSupported)
        {
            blackberry.location.setAidMode(1);
            blackberry.location.refreshLocation();
            document.formindex.elements['GpsCoordinate'].value = blackberry.location.latitude + "," + blackberry.location.longitude;
        }
        window.alert(document.formindex.elements['GpsCoordinate'].value);
        return true;
    };
    </script>

</asp:Content>
The problem is that the GpsCoordinate gets updated the first time only, all request after shows the same gps coordinate as previous. Would it be a problem with the javascript? I've also noticed that if a break into the server code and wait for 5 seconds before continuing, the gpsCoordinate gets updated correctly?? strange?

My second question is regarding a second application that would be running in the background on the device. I would like to record the gps coordinate every 30 seconds and send them to a web service on my server via http. Can this be achieve without using mds as my client does not have it and my provider (bell mobility) does not seem to have apn. Could i just be sending http request with this background application and use the browser for my mobile web site in the same time?

Any pointer and comment will be very appreciate.
thanks
mateo
Offline  
Old 05-05-2008, 06:52 PM   #2
mateo666
New Member
 
Join Date: May 2008
Model: 8830
PIN: N/A
Carrier: bell
Posts: 11
Default not updating

Nobody??

the location is only updated once? I even tried to make a button just show the coordinate without posting back and the coordinate doesnt change?
Is this the correct behavior of the javascript?

Please help
Offline  
Old 05-06-2008, 10:38 AM   #3
mateo666
New Member
 
Join Date: May 2008
Model: 8830
PIN: N/A
Carrier: bell
Posts: 11
Default

ok i think i found why...

i realized that if i click on a link before the page as been completely received (the blue arrow in the top right corner is still showing activity) then the coordinate would not update but if i wait till it dissapear then the coordinate is updated..

Someone knows why?

But now is there a way to prevent a user from clicking till the page is entirely received? What could possibly be going on if the page is rendered correctly, everything seems to be there but the blue arrow stays there for at least 5 seconds?

Thanks
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black) picture

BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black)

$37.96



Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030 picture

Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030

$28.88



4.5 CFM Single-Stage Rotary Vacuum Pump HVAC/Auto AC 4.5CFM 1/3HP 1/4

4.5 CFM Single-Stage Rotary Vacuum Pump HVAC/Auto AC 4.5CFM 1/3HP 1/4"ACME inlet

$45.98



Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW picture

Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW

$35.00



Robinair 15500 VacuMaster Economy Vacuum Pump - 2-Stage, 5 CFM , Red picture

Robinair 15500 VacuMaster Economy Vacuum Pump - 2-Stage, 5 CFM , Red

$214.99



3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit picture

3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit

$46.03







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.