S
Simon Harvey
Hi everyone,
I'm having a frustrating problem and I don't know how to fix it without
totally redoing a very complicated couple of pages on my site. I really hope
some kind soul can help me
Its a very simple situation:
I have 1 page that serves to create and update users and another page to add
roles to the user.
In order to keep the state as the user moves back and forward between these
two pages, I've made a session entity class that I add to the Session when
moving between these two particular pages.
Thats all fine.
When the user arrives at the Create/Update page, it checks to see if the
session entity exists. If it does, then it loads the user interface with the
info in the entity object.
Also fine.
The problem occurs when the user comes to the page, half creates a user then
goes away from the page using one of the several links on the page and then
returns to the page.
Because the Session Entity still exists from the last occasion the user was
at the Create/Edit page, the page loads the data from it even when it
shouldnt.
The end result is that the UI gets populated with values that it definately
shouldnt!
My question is generic - how can i stop this from happening? I know people
use Process State objects for managing a multestage process all the time, so
this situation must arise all the time. I'm hoping theres some sort of
design pattern for it.
The only way I can think to prevent the problem is to detect when the user
moves away from the page by using the links on the page and delete the
session object when moving away from the 2 create/update pages.
Does anyone know how I can detect when the user moves away from two
particular pages?
Sorry thats quite a complicated explanation. I really hope someone can help
Thank you
Simon
I'm having a frustrating problem and I don't know how to fix it without
totally redoing a very complicated couple of pages on my site. I really hope
some kind soul can help me
Its a very simple situation:
I have 1 page that serves to create and update users and another page to add
roles to the user.
In order to keep the state as the user moves back and forward between these
two pages, I've made a session entity class that I add to the Session when
moving between these two particular pages.
Thats all fine.
When the user arrives at the Create/Update page, it checks to see if the
session entity exists. If it does, then it loads the user interface with the
info in the entity object.
Also fine.
The problem occurs when the user comes to the page, half creates a user then
goes away from the page using one of the several links on the page and then
returns to the page.
Because the Session Entity still exists from the last occasion the user was
at the Create/Edit page, the page loads the data from it even when it
shouldnt.
The end result is that the UI gets populated with values that it definately
shouldnt!
My question is generic - how can i stop this from happening? I know people
use Process State objects for managing a multestage process all the time, so
this situation must arise all the time. I'm hoping theres some sort of
design pattern for it.
The only way I can think to prevent the problem is to detect when the user
moves away from the page by using the links on the page and delete the
session object when moving away from the 2 create/update pages.
Does anyone know how I can detect when the user moves away from two
particular pages?
Sorry thats quite a complicated explanation. I really hope someone can help
Thank you
Simon