1

I have created a sample application with login page and home page.

i have loaded the login page as Main Page successfully and i have homePage.html/homePage.js files. What i need to do is, when i click on Login button from loginPage.html file, user should navigate to Home Page. I couldn't see any APIs fro navigate/load to different html files.

i referred some worklight samples it says loading on same HTML using div and pageport commands.

$("#pagePort").load("pages/homePage.html", function(){
        alert("Home Page Loaded")
    });

Can any one help me to get resolve, how we can load another html on click of login button?

Ravi
  • 151
  • 2
  • 13

1 Answers1

1

Worklight is a single DOM application, hence the notion of "pages" is an artificial one.

You have 1 singular HTML file and what you need to do is replace content inside it to display different content, or "pages".

There are numerous ways you can accomplish this. None of them relate directly to Worklight, but to the framework you select to work with, be it jQuery, jQuery Mobile, Dojo, Ionic and so on...

The important thing to remember is to never navigate away from the index.html file because you will then "lose" the Worklight context and your application will then fail loading. The reason is because from the index.html file, you load various required Worklight-related files.


In this Worklight 6.2 project I demonstrate, using jQuery Mobile, how to navigate between pages. For your purpose, think of them as a mainpage that is a login page and then some other page that is the home page...

Related:

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89