I have a simple application. Two A5W pages with a dialog component in each of them. I fill out some data on the first page and then move to the second page. I use a session object to transfer elements to the second page. When I hit the back button on the browser, it goes to the first page, but the dialog component is refreshed to the default state (vs have the last state when the user was on that page.). I have thought of a couple of ways to handle it, but I wanted to get feedback from the group on the best practices.
1) I could have two pages with a dialog on each one. Then I would put the code in the initialize event to restore the state from a session dialog.
2) I could have both dialogs on the same page and then have some glue code that hides/displays the dialog depending on the status. I would have to write some code in the dialogs to call the page which would then control visibility.
3) I could have a single dialog with two containers for the two "pages". And use the logic in the dialog to hide/display containers. (Simplest of the bunch...but I have concerns)
NOTE: Both pages are fairly complex so one of my key concerns is download/load time for each of the pages. And....with a ton of components on a single page (from dual dialogs on a single page) I don't want to trigger strange problems with the browsers.
So.....
1) Is there a simple way to store and then restore the state of a dialog component without having to right a lot of logic (i.e. I don't have to get a session variable and then update all of the controls on the dialog to set them to the original state.)
2) If I go the two dialogs on one page, do I run the risk of long load times and/or performance issues because of the large set of components on a single page? Also, how would I structure the code to trigger the
3) Ditto for two big containers in one dialog, long load times/performance issues?
I know this one is a bit long...but will help me establish best practices for coding my web applications going forward. Thanks in advance.
1) I could have two pages with a dialog on each one. Then I would put the code in the initialize event to restore the state from a session dialog.
2) I could have both dialogs on the same page and then have some glue code that hides/displays the dialog depending on the status. I would have to write some code in the dialogs to call the page which would then control visibility.
3) I could have a single dialog with two containers for the two "pages". And use the logic in the dialog to hide/display containers. (Simplest of the bunch...but I have concerns)
NOTE: Both pages are fairly complex so one of my key concerns is download/load time for each of the pages. And....with a ton of components on a single page (from dual dialogs on a single page) I don't want to trigger strange problems with the browsers.
So.....
1) Is there a simple way to store and then restore the state of a dialog component without having to right a lot of logic (i.e. I don't have to get a session variable and then update all of the controls on the dialog to set them to the original state.)
2) If I go the two dialogs on one page, do I run the risk of long load times and/or performance issues because of the large set of components on a single page? Also, how would I structure the code to trigger the
3) Ditto for two big containers in one dialog, long load times/performance issues?
I know this one is a bit long...but will help me establish best practices for coding my web applications going forward. Thanks in advance.
Comment