those examples (like those auto links) are bookmarkable pages.
And a bookmarkable url wil always make a new page (there are talk about
stable pages, 1 instance for a session but that is today just an idea)

When you do a submit (like form input) then you target the same page.
or click on links or buttons on:
http://wicketstuff.org/wicket13/linkomatic/for example the Action
link clicked 0 
times<http://wicketstuff.org/wicket13/linkomatic/?wicket:interface=:1:actionLink::ILinkListener:>

And yes if you create a bookmarkable link new PageLink("xx", Page1.class) or
BookmarkablePageLink("xxx", Page1.class)
then a new instance is being created. As i said above we don't have those
"stable pages" where only one instance per session can be there..
We internally don't pool.

setResponsePage(new Page()) or setResponsePage(previousPage)
that will result in the reuse of those pages.

and yes that you need to do your self. Wicket is un managed it doesn't do it
for you.

johan



On 4/25/07, Daniel Stoch <[EMAIL PROTECTED]> wrote:

Hi,

I don't fully understand a concept of state management in Wicket:
"One of the primary objectives was to make state management a Java
thing that is abstracted away from implementation details like
HttpSession. In Wicket, state is stored in components that are nested
in Pages which are all contained in a map in the user's session. All
of this is very well defined and occurs "behind the scenes"."

But in almost all examples available on Wicket pages, every time I
choose a link from one page (Page1) to another one (Page2), a new
instance of that Page2 is created.

Examples:
1. I can do it by placing a link inside a <wicket:link> tags on Page1:
<wicket:link>
<a href="Page2.html">Goto second page</a>
</wicket:link>
2. I can create a link in the Page1 code:
add(new PageLink("linkToPage1", Page1.class));

etc...

But what about a state of that page? I want to have exactly the same
state of Page2, each time when I choose a link to it from other pages.
State is stored inside a page, so should I store a reference to the
first instance of my Page2 somewhere (eg. inside a session object) and
change all of links to Page2 to something like this:
add(new PageLink("linkToPage1", mySession.getPage2Instance()));

Or should I store a page state inside a session manually (in some
object or model instance) and pass this state to the new instance of
Page2 in constructor like this:
add(new PageLink("linkToPage1", new
Page1(mySession.getMySavedModelForPage2())));

But then it does not occur "behind the scenes".

--
Daniel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to