user1521828
user1521828

Reputation: 57

Wicket Passing parameters between Pages

I am new to wicket. I have a wicket application class from which has Login page as the home page. after Login user is taken to a page (page X) where user selects the system (user can have access to multiple systems) where user wants to navigate.

Now for a new requirement, client would be given URL with specific system Id. If the URL has that parameter (e.g. ...?system=22), login page would get that parameter. Post login user would be taken to the system (22) screen and the in between page (page X) would be skipped. To achieve this I need to pass the parameter from login to the next page (page X) which would auto select the system and takes the user to system (22) screen.

What is the best way to pass parameters from one page to another page. Is following the correct way:

from first page after successful login:

setResponsePage(NextPage.class, params);

Params would have the system Id.

Thanks in advance

Upvotes: 0

Views: 1594

Answers (1)

biziclop
biziclop

Reputation: 49714

In general, yes.

And in the target page class there has to be a constructor that accepts PageParameters.

However in the special case of a login page this isn't a good idea as there are several ready-made solutions. This for example. Even if you don't want to use them, you can still use the built-in intercept page support.

Upvotes: 2

Related Questions