Starting WebApp initialize all views....

Hi,
I have following situation: Starting with a LoginView I navigate depending on authentication via navigateTo to another view called WorkView. The username is added to the session. Depending on the username I show some data in WorkView. Now: The webapp initializes all view before authentication ( I assume this is right?) , but when I navigateTo workview nothing is triggered to select the data accordingly. I can build a button which reads the username from session and select the data but this is not a good way. The user expect HIS data when opening the WorkView and not needed to click a button.
What can I do? Is there a way to initialize the WorkView when navigateTo is called? Or can I force the view the refresh everything after the navigateTo?

I appreciate any help,
Thx,
Hans

Hi,

  1. to solve your problem you could use

a)

@Override public void enter(ViewChangeEvent event) { // check for the user in the session and do some stuff here } b)

@Override public void attach() { super.attach(); // check for the user in the session and do some stuff here } 2.
You shouldn’t inititialize your views before you are authorized and before you really want to enter them.
To solve that you should show some code. Where is your WorkView and your navigator initialized?
Where do you check for the user and redirect to the LoginView?

Thx, a) did the job…