Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 37
Registered: ‎03-10-2011
My Device: Not Specified

PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

  Hello,

 

I have a very simple PlayBook app to demonstrate this issue.  Just hitting the Next button to go to next.html, it just hangs there showing "Loading" and the CPU goes high, any ideas what I'm doing wrong?

 

index.html

<html>
<head>
    <title> test</title>
    <meta id="viewport" name="viewport" content="width=device-width" />
    <link href="jquery.mobile1.0a3.min.css" rel="stylesheet" type="text/css" />
    <script src="jquery-1.5.min.js"></script>
    <script src="jquery.mobile1.0a3.min.js"></script>
</head>

<body>
    <div data-role="page">
        <div data-role="header" data-position="inline" >
            <h1>test</h1>
            <a href="next.html" data-icon="plus" class="ui-btn-right">Next</a>
        </div>
        <div data-role="content">
            <p id="userInput">
                test: <br/>
                <textarea id="txtMessage" rows="3" cols="30"></textarea> <br/>
            </p>
        </div> <!-- /content -->
    </div> <!-- /page -->
</body>
</html>

 

next.html:

 

<HTML>
    <head>
        <title> test2 </title>
        <meta id="viewport" name="viewport" content="width=device-width" />
        <link href="jquery.mobile1.0a3.min.css" rel="stylesheet" type="text/css" />
        <script src="jquery-1.5.min.js"></script>
        <script src="jquery.mobile1.0a3.min.js"></script>

    </head>
    <body>
        test
    </body>
 </HTML>

 

Thanks

Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

Nothing. This is simply not working on the current PlayBook simulator.

 

A workaround is to define various divs in the same page like:

 

 

<div data-role="page" id="page1">
...
</div>
<div data-role="page" id="page2">
...
</div>

 

 

and just link to #page1 and #page2

 

The fact that it's broken probably has something to do with the other current local AJAX problems.

 

I use this approach to flip back and forth from the main screen and the about page in my Unit Converter (see signature for source)

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Contributor
Posts: 37
Registered: ‎03-10-2011
My Device: Not Specified

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

Marco, thanks.
So this is simulator specific issue and in theory it should run fine on the actual HW? How did you find out about the workaround?

Is there a release note/known issues I should be looking at to know these type of problems so I don't bother the forums & you?

Many thanks for all your help and your speedy answers.

Cheers
Developer
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB
My Carrier: Sprint

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

Hey totem,

 

No problem, happy to help!

 

I suspect the fact that it's not working is that JQuery Mobile fetches these pages through a local AJAX request. There are currently issues with those requests returning a status code 0 rather than 200 and I think JQuery mobile chokes on that. Again, this is just a theory.

The good news is that this AJAX issue will be fixed in the next release of the SDK.

 

I don't think this issue is in any release notes really. It has come up in various problems people were having on the forum, including myself actually. And I wouldn't worry about bothering people here. These forums are for developers to help eachother out, no? Smiley Happy

 

I found out about the workaround simply because i set up my app to have the two needed pages in one document from the start. Later on I tried to split them into two documents which is when I found out that didn't work. 

 

If you're developing a JQuery mobile app please do look at the source of my Unit Converter. I'm sure you'll find some helpful things in there!

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Contributor
Posts: 37
Registered: ‎03-10-2011
My Device: Not Specified

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

[ Edited ]

Thanks. :-)
I'll download the sources soon. For clarification, I'm almost done with my app but I wanted to split some of the functionality into a better flow/be cleaner.
Thanks for sharing the sources.

Do you know if it will be easy to switch from having the app free to charging some $$?

Have you develop for Blackberry (Phone) before?

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

I'm not sure if the 0 status code instead of 200 will be fixed in the next beta release.. but it has been marked as a critical gating issue for the 1.0 release.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 37
Registered: ‎03-10-2011
My Device: Not Specified

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

tneil, all, I'd like to fix some issues with my app, and would like to make my code cleaner. Has this been addressed and can now use multiple html files and HREF them back and forth without a problem?
thanks
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

I believe the issues with local page access through AJAX have now been fixed.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Highlighted
Contributor
Posts: 25
Registered: ‎03-31-2011
My Device: Playbook
My Carrier: N/A

Re: PlayBook: jQueryMobile trying to A HREF='next.html' hangs in 'Loading'

I recently updated to the latest SDK and simulator and this bug was very much still an issue. My app would fail with the 'loading' message whenever a link was clicked.

However, I was able to fix this 100% by updating to JQuery 1.6. This sorted out all local ajax loading issues.

I just have to resubmit my app as it's been getting awful reviews, understandably as it wouldn't work at all.