PDA

View Full Version : How to route directly to a bookmarked page after login in ExtJs4.2.x



sourav_nf
21 Oct 2016, 12:04 PM
I am sucessfully using a ExtJs 4.2.x application with login page and proper login window, everything under a single URL:
http://<IP>/<MyApp>
There are multiple windows and forms and tabs that open/pop up from the main page after login which do the rest of operations (most REST proxy calls and showing/saving data back to the server)
Only page transition happen is the login page lands to the main page with corresponding role. WITHOUT changing URL



//Login controller
//After successful login
usrController.saveSession(item.id,username,response.userFirstName,userSelectedLocation);
mainController.showMainView();
win.destroy();
this.up().destroy();
...
//New main page view generation controller
var user = this.getController('MyApp.controller.UserController').getUser();
if( user.data.role === 'Role 1' ){


mainFormPanel = Ext.create('MyApp.view.FormPanel1', {});
center_container = this.getViewport().down('container[region=south]');
center_container.add(mainFormPanel);


this.getUserStoreStore().load();
Ext.getCmp('displayUserNameLabel').setText('<i>Welcome </i>! &nbsp;'+'<b>'+user.data.userFirstName+'</b>&nbsp;&nbsp;|&nbsp;&nbsp;Location:&nbsp;<b>'+user.data.userloc+'</b>',false);
}
else if( user.data.role === 'Role 2' ){
.....







Now my ASK is:
The business demands page bookmarking, where they can directly land to a specific window/form/panel (which only pops up now) after LOGGING.
User is supposed to have a bookmark link where they click and then get a login credential validation through the login page and then land directly to the bookmarked window/form/panel (which only pops up now on an event) .
I am not at all sure how to achieve this with the ExtJs 4 framework through IDE although we are trying to rely a lot on this framework and licenses to scale it up to next level in the coming year.
Please help!!!:-/

Gary Schlosberg
21 Oct 2016, 1:06 PM
Are you using cookies to manage the users sessions? To which IDE are you referring?

Support for Ext JS 4 will end on December 31st. While extended support may be an option for you, you may also want to look into Ext JS 6 if you are making plans for the coming year.

sourav_nf
22 Oct 2016, 7:34 AM
Are you using cookies to manage the users sessions? To which IDE are you referring?

Support for Ext JS 4 will end on December 31st. While extended support may be an option for you, you may also want to look into Ext JS 6 if you are making plans for the coming year.


by IDE, I mean to say Sencha Architect 3. I haven't used cookie through this framework. Can you please guide me through an example of how to achieve this through Sencha Architect. Login check is a must in this scenario.

Regarding extended support, we will be surely looking for it because we cannot rewrite the thousand lines of code in Ext JS 6 and if this requirement works, there will be a lot of work coming in next year.

sourav_nf
25 Oct 2016, 9:43 AM
by IDE, I mean to say Sencha Architect 3. I haven't used cookie through this framework. Can you please guide me through an example of how to achieve this through Sencha Architect. Login check is a must in this scenario.

Regarding extended support, we will be surely looking for it because we cannot rewrite the thousand lines of code in Ext JS 6 and if this requirement works, there will be a lot of work coming in next year.


An urgent answer will be of a great help!

Jad
25 Oct 2016, 11:58 PM
Hy,

what about that http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/history/history.html#main-tabs:tab5

sourav_nf
26 Oct 2016, 1:09 PM
Hey. Thanks for the link. I had gone through this before as well, but it has not shown any way/component to store and load the page data dynamically as well as I need a complete window change, just not a tab navigation.
Basically my need is to bookmark a navigated window and then when I click it back it should land me there through login validation