On 8/12/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> 
> > This is what I am currently trying to do. I do not like that Wicket
> > creates a new instance of component each time when I navigate to it. I
> >
> this is just not true. If you navigate you are pressing links that you
> have created
> And what you do in that link is complete up to you.
> Just set a new instance instead of a class of a page.

In SignIn example link look like this: <a href="signin">signin</a> As
you can see, there is no additional parameters, it simply navigates to
signIn. WebRequestCycle considers this link as a homepage, and calls
setResponsePage(homePage). At least in this case Wicket does not
create a new instance. But in case of bookmarkable page Wicket calls
Page newPage = 
  session.getPageFactory().newPage(pageClass,
  new PageParameters(getRequest().getParameterMap()));
which is not exactly what I want. But I have not gotten there yet, so
I cannot tell for sure ;-)

> What application object are you talking about?
> The wicket? That one is not stored in the session!
> Application is global, only one instance lives there.
> If you want to share things you have to store it really in the session.

how about getSession().getApplication() ? Oh, I see, getSession() is
not HttpSession. I think Session object should be renamed to
WicketSession to avoid ambiguity.

> > Another thing: I now need a link with initializing parameter, which
> > will tell Page to reset its data. I check this parameter in
> > WebRequestCycle or what it is called (don't have time to look in the
> > source right now). Parameter is checked ok, but then I want to set
> > "mustReset" field in the Page. I added this field to the Page class.
> > So, seems that it does not work, or I update a different instance.
> > This is what I will have to resolve.
> >
> Give a link that param.
> And i do mean the Link object in java. You don't need to have it on the
> client side.
> You shouldn't have any need to store/push information to the browser.
> Just create a link that has that param that sets that param on the page
> in the onClick()

Link class in just an abstraction. It all boils down to a good old
HTTP/HTML. Wicket parses a regular HTTP requests, which does not know
about Link objects. I already gave you example of start page in SignIn
example, the page is pure HTML.

Before creating my own Link objects, I need to understand how Wicket
parses request parameters.

But you are right that in the end of the day I will have to create a
Link, which will generate proper <a href> for me.

Michael.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to