Pls check the cdapp example; the details page goes back to the page with the search etc. What I do there is just keep a reference to the page I came from, a redirect to that page when I'm done with the details. That works, though we're planning to have better support for navigation between pages in the near future.

Other options are to use/ switch panels instead of whole pages, or giving enough parameters for your page construction so that you'll be able to recronstruct your last search form etc.

Eelco

Kristof Jozsa wrote:

Eelco,

thanks for your answer, but I'd like to ask the other way around: what should I do in a Page to force giving back the same page instance to the user?

Eg. I've got a Menu component (extending Panel) which allows navigation between pages, and 2 example pages. On the first page, I use a search form and a paging results list which is only shown if the form got already posted. If I post the search form, switch to Page2, switch back to Page1, I see the empty search form again, as the page is reinstantiated. The expected behaviour would be showing the filled search form and the list with the results even after switching pages back and forth. How can I achieve this?

Again, sorry for asking noob questions.

thanks,
Kristof


Eelco Hillenius wrote:

A page is instantiated when:
- you clicked a bookmarkable link (e.g. http://localhost:8080/wicket-examples/navomatic?bookmarkablePage=wicket.examples.navomatic.Page2);


- you went to the Home page;
- you instantiated it yourself or had a page factory instantiate it, e.g. by using a PageLink or something like: setResponsePage(new SomePage());


In all other cases (unless I forgot something) the current page is used. So, a construct like:

       final Link actionOnClickLink = new Link("actionOnClickLink")
       {
           public void onClick()
           {
               onClickLinkClickCount++;
           }
       };

when clicked finds the current page in the session, and calls the IRequestListener method (onClick) of the targeted component on that page.

The above link generates links like:
http://localhost:8080/wicket-examples/linkomatic?component=2.actionLink&version=0&interface=ILinkListener



which you can read as: call the interface method of ILinkListener on the page in session with id 2, component actionLink, version 0.


Pages get numbered from 0 in your session, and the component path is seperated by dots. Another example of a link is:
http://localhost:8080/wicket-examples/displaytag?component=2.header.email.actionLink&version=1&interface=ILinkListener



in this case, component with path head->email->actionLink in page with id '2' is targetted.


Hope that helps,

Eelco


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to