I am new to JQuery Mobile. I have an Apache Wicket-based application that I'd like to try JQuery Mobile on so it looks more pleasing on mobile devices. Unfortunately, I am getting "Error Loading Page" errors for all the page links, which I never had problems with before switching to JQuery Mobile. The root cause appears to be the URLs contained in the HTTP requests. I used JQuery Mobile 1.2.0, JQuery 1.8.0, Wicket 1.5.5, locally tested using jetty server 6.1.26 and FireFox 16.0. Here is the code snippet:
- <ul data-role="listview" data-theme="b">
- <li><a href="#" wicket:id="metaprofileList" rel="external">List</a>
- </li>
- </ul>
The corresponding java code:
- add(new BookmarkablePageLink<MetaprofileListPage>(
- "metaprofileList", MetaprofileListPage.class));
Based on the above, Wicket correctly replaced "#" in href="#" with real URLs where the pages are, so the final HTML looks like the following:
- <ul data-role="listview" data-theme="b">
- <li><a href="com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage" wicket:id="metaprofileList" rel="external">List</a>
- </li>
- </ul>
When the link is clicked , Jetty server sends the following HTTP Request with the following URL:
- GET http://127.0.0.1:7999/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage [HTTP/1.1 404 Not Found 0ms]
This is not a correct URL for the MetaprofileListPage. Before I switched to JQuery Mobile, I tested with the same scenario, the same jetty server send the following HTTP Request with the CORRECT url:
- GET http://127.0.0.1:7999/wicket/bookmarkable/com.alcatel_lucent.nms8770.awol.client.web.page.MetaprofileListPage?7 [HTTP/1.1 200 OK 0ms]
The only change I did was switching the headers in the HTML file from:
- <link rel="stylesheet" type="text/css" href="../../css/phone.css" media="only screen and (max-width: 480px)"/>
- <link rel="stylesheet" type="text/css" href="../../css/default.css" media="only screen and (min-width: 1025px)"/>
- <link rel="stylesheet" type="text/css" href="../../css/portrait.css" media="all and (max-device-width: 1024px) and (orientation:portrait)"/>
- <link rel="stylesheet" type="text/css" href="../../css/landscape.css" media="all and (max-device-width: 1024px) and (orientation:landscape)"/>
- <meta name="viewport" content="user-scalable=no, width=device-width"/>
-
To the standard boilerplate jquery mobile includes:
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
- <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
I have been struggling with this for 2 weeks now :-( What do I need to do to get JQuery Mobile to work loading the correct urls/pages? Please help!! Many thanks!!