PDA

View Full Version : Page Navigation in Ext JS 4.0



abhinavchugh
26 Jun 2012, 10:19 PM
Hi

In my application , I want to show the default page after login into the application. how should i navigate from login page to default page. Please help me out.

scottmartin
29 Jun 2012, 7:35 AM
You can use window.location = 'url'

Scott.

el_chief
29 Jun 2012, 9:47 AM
Hi

In my application , I want to show the default page after login into the application. how should i navigate from login page to default page. Please help me out.

is this a single page application or a multi-page application. and by page i mean actual HTML file.

friend
29 Jun 2012, 10:34 AM
I use Java and Spring's MVC & Security Frameworks on the back-end, where Spring Security prevents you from calling any request URLs (with the exception of the actual "login" request mapping) unless you're authenticated and have the proper ROLE descriptors. This causes a lot of application init problems, such as not being able to preload a data store during application startup, where an unauthenticated user doesn't have permissions to call any URLs which retrieve data.

To get around this, I use a hybrid MVC approach. In a nutshell, the login page is non-MVC and only loads /app/view/Viewport.js (which is also used by the MVC side of the application, to keep the same app look/feel) and a login.js file (which is a simple Ext.Window with a login Form panel). I add an Ext.onReady() block to the page which instantiates the Viewport and Login window. The Form panel in the Login window uses standardSubmit: true, so a full-page submit is performed when the user clicks the Login button.

If the user authenticates successfully, Spring Security redirects them to the Home page, which kicks off the full-blown ExtJs MVC application life-cycle, preloads any data stores, etc (since the user is now authenticated and has permissions to call the appropriate URLs to retrieve data).

Otherwise, if authentication fails, Spring Security redirects the user right back to the Login page (where a request attribute with any login failure message is also forwarded along with the page).

Hope you find this helpful and that my wording isn't too confusing...

abhinavchugh
9 Jul 2012, 1:55 AM
is this a single page application or a multi-page application. and by page i mean actual HTML file.

I am making a single page application.