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


FANUC Servo Amplifier A06B-6240-H208 picture

FANUC Servo Amplifier A06B-6240-H208

$3199.00



 MITSUBISHI Amplifier MITSUBISHI MR-J2S-200B MITSUBISHI MRJ2S200B AC Servo Drive picture

MITSUBISHI Amplifier MITSUBISHI MR-J2S-200B MITSUBISHI MRJ2S200B AC Servo Drive

$485.00



1pcs Fanuc Servo Amplifier A06B-6077-H002 New by DHL or EMS picture

1pcs Fanuc Servo Amplifier A06B-6077-H002 New by DHL or EMS

$1089.00



Acoustic Power Systems Amplifier 114 APS Dynamics  Model 114  - Navcon USED picture

Acoustic Power Systems Amplifier 114 APS Dynamics Model 114 - Navcon USED

$379.99



USED SKAR AUDIO SK-M5001D 500W RMS ULTRA COMPACT CLASS D MONOBLOCK CAR AMPLIFIER picture

USED SKAR AUDIO SK-M5001D 500W RMS ULTRA COMPACT CLASS D MONOBLOCK CAR AMPLIFIER

$94.99



Mini-circuits High Power Amplifier ZHL-5W-1X+ picture

Mini-circuits High Power Amplifier ZHL-5W-1X+

$347.50







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