Topic
  • 2 replies
  • Latest Post - ‏2012-11-20T12:57:17Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic Make WL works if i do a location.href redirect

‏2012-11-20T11:24:35Z |
Hello,
i cannot resolve this problem.

In my application-descriptor.xml is defined a <mainPage> in wich worklight injects all its css and js.

If i am in mainPage.html and do a location.href = "anotherPage.html" i got the error "WL is not defined", beacuse there aren't all the WL js files. I try to manual insert all the <script> tag of worklight in my anotherPage.html and it works, but i think is not a good way of do things.

The change page works only if i use jquery mobile's changePage method that is AJAX-based.

Is there a solution?
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Make WL works if i do a location.href redirect

    ‏2012-11-20T11:33:16Z  
    Hi.

    Worklight is a single-page application. As such what you're trying to do is not possible within the constraints of Worklight.
    If you'd like to use multiple pages, you can indeed use 3rd party solutions such as jQuery Mobile.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Make WL works if i do a location.href redirect

    ‏2012-11-20T12:57:17Z  
    • IdanAdar
    • ‏2012-11-20T11:33:16Z
    Hi.

    Worklight is a single-page application. As such what you're trying to do is not possible within the constraints of Worklight.
    If you'd like to use multiple pages, you can indeed use 3rd party solutions such as jQuery Mobile.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Thank you for you response.