Topic
  • 8 replies
  • Latest Post - ‏2012-12-09T08:04:23Z by AntonAleksandrov
SystemAdmin
SystemAdmin
570 Posts

Pinned topic [Solved] Navigating between pages

‏2012-04-13T03:03:15Z |
Hi,
My hybrid application has multiple html pages. What is the recommended way to navigate between pages? Is

<a href=
"test.html">Test Page</a>
the correct way to do it? Or is PageFragment the best way to achieve this? Can you please suggest?
  • IdanAdar
    IdanAdar
    288 Posts

    Re: [Solved] Navigating between pages

    ‏2012-04-13T08:24:28Z  
    A mobile app has only 1 page; to simulate navigation between multiple pages you can use Worklight's Pages and Fragments approach, or use an external library such as jQuery Mobile that have its own approach to this.
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: [Solved] Navigating between pages

    ‏2012-04-13T12:35:51Z  
    Thanks for your kind reply Idan. Can you please let us know how to do this using jQuery mobile?
  • IdanAdar
    IdanAdar
    288 Posts

    Re: [Solved] Navigating between pages

    ‏2012-04-13T13:57:54Z  
    Not off the top of my head... :) for this you will need to read jQuery's own documentation...

    However, for starters, read the following module: Module 25 - Worklight and UI Frameworks.
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: [Solved] Navigating between pages

    ‏2012-04-16T14:51:45Z  
    Thanks a lot for your help Idan. We will refer JQuery documentation and try to figure it out.
  • ahmad3ttallah
    ahmad3ttallah
    1 Post

    Re: [Solved] Navigating between pages

    ‏2012-08-21T10:01:19Z  
    @IdanAdar

    When I use Worklight approach, the UI rendering system does not work anymore.
  • IdanAdar
    IdanAdar
    288 Posts

    Re: [Solved] Navigating between pages

    ‏2012-08-21T10:27:28Z  
    As you did not explain what it is you're doing, I cannot help you.
    Please open a separate thread.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • icw
    icw
    2 Posts

    Re: [Solved] Navigating between pages

    ‏2012-12-06T04:32:25Z  
    • IdanAdar
    • ‏2012-08-21T10:27:28Z
    As you did not explain what it is you're doing, I cannot help you.
    Please open a separate thread.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    I'll tell you exactly what he is doing... trying to use your pages and fragments demo to create a multi page web app using INDUSTRY STANDARD MULTIPLE PAGES...

    This means we would all like to create web apps, with multiple pages, so that we do not have to create a multi-page web app in one single page.

    Basically, we are all using your Pages and Fragments demos, and your single and double authentication demos, to try and create web apps. If you need reference for how this works... they behave like a web site with multiple pages. This means you DO NOT load all of your content in the main page, and separate out your structure in to multiple pages and folder hierarchies so it is maintainable. Also, we should not have to create an adapter just to create something simple such as a multi page form. Also, it's getting a bit annoying that all references to maintainable multi-page apps end with "You should use 3rd party frameworks such as JQuery Mobile, Sencha or Dojo".

    Here's the issue, when you create a standard link in worklight, it breaks it out of the main page, this means it looses all connections to the JS and CSS libraries that are loaded when you deploy your app. Please advise IBM that in your next update, you should have some logic to add simple inter-site/app linking without having to keep everything in one master file and use a show/hide method or using a third party framework. Also, the breadcrumbing should be native so that we do not have to build up our own navigation and add 400 lines of script just to have a link to another page and make sure when the user presses the back button on their phone that they stay in the app and do not get bounced back to where they came from. This should be something being done already, why it is not I do not know. Also, as per some of your other posts, Pages and Fragments are being deprecated... So how do we create new pages and load them? And please don't reply you should look at JQuery Mobile or use one main HTML file... this is not maintainable.
  • AntonAleksandrov
    AntonAleksandrov
    22 Posts

    Re: [Solved] Navigating between pages

    ‏2012-12-09T08:04:23Z  
    • icw
    • ‏2012-12-06T04:32:25Z
    Hi Idan,

    I'll tell you exactly what he is doing... trying to use your pages and fragments demo to create a multi page web app using INDUSTRY STANDARD MULTIPLE PAGES...

    This means we would all like to create web apps, with multiple pages, so that we do not have to create a multi-page web app in one single page.

    Basically, we are all using your Pages and Fragments demos, and your single and double authentication demos, to try and create web apps. If you need reference for how this works... they behave like a web site with multiple pages. This means you DO NOT load all of your content in the main page, and separate out your structure in to multiple pages and folder hierarchies so it is maintainable. Also, we should not have to create an adapter just to create something simple such as a multi page form. Also, it's getting a bit annoying that all references to maintainable multi-page apps end with "You should use 3rd party frameworks such as JQuery Mobile, Sencha or Dojo".

    Here's the issue, when you create a standard link in worklight, it breaks it out of the main page, this means it looses all connections to the JS and CSS libraries that are loaded when you deploy your app. Please advise IBM that in your next update, you should have some logic to add simple inter-site/app linking without having to keep everything in one master file and use a show/hide method or using a third party framework. Also, the breadcrumbing should be native so that we do not have to build up our own navigation and add 400 lines of script just to have a link to another page and make sure when the user presses the back button on their phone that they stay in the app and do not get bounced back to where they came from. This should be something being done already, why it is not I do not know. Also, as per some of your other posts, Pages and Fragments are being deprecated... So how do we create new pages and load them? And please don't reply you should look at JQuery Mobile or use one main HTML file... this is not maintainable.
    Hello,

    IBM Worklight applications are based on a single DOM model - you have a single HTML file that is loaded by the browser. This HTML file contains references to IBM Worklight JavaScript framework files (and Cordova framework for mobile environments).
    Navigating from this HTML file to other HTML files by using anchors will cause loosing your JavaScript context and render WL and Cordova APIs unusable.
    This does not mean, however, that you cannot use separate HTML files for various components of your application. It is absolutely possible and relatively easy. The idea is to load external (not the main one) HTML files using AJAX and inject them into existing DOM.
    Each JavaScript frameworks available on the internet today (e.g. jQuery Mobile, Sencha Touch, Dojo Mobile) has it's own way of implementing it. All of them can be used with Worklight.
    If you do not want to use any JavaScript framework - it is still possible by using APIs provided by Worklight. In the latest release (5.0.5) we've deprecated WL.Page and WL.Fragment APIs, but we provide a tutorial and sample on how to achieve the desired functionality by using AJAX.

    Tutorial - ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/Module_07_5_-_Building_a_Multi_Page_Application.pdf
    Sample - ftp://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v505/module_07_5_MultiPageApplication.zip