I think one of the keys to getting comfortable with Wicket is to
think in terms of plain objects rather than requests, pages, etc. For
example, if you were working with a Person object rather than a Login
page and you wanted to provide some way of modifying that Person
object, you would just add a mutator method to the Person class,
right? Well, it's the same thing in Wicket. Just add a method to the
Login page class that performs whatever modifications you want. This
method might update the models for components on that page, change
the visibility of components, replace components with other
components, just to name a few possibilities.
In the example you gave, this method (the Login page's mutator
method) would be called from the onClick() method in the Welcome
page's Link, just before calling setResponsePage().
hth,
-Ryan
On Jul 27, 2007, at 11:20 AM, Will Jaynes wrote:
I'm new to Wicket and struggling a bit. I feel I may be stuck in
old thinking of action frameworks like Struts or Spring MVC.
All of the examples I have looked at so far do all the work of
creating and adding components for a page (or panel) in the
constructor of the page. Are there other places where this work can
be done? In a dynamic page, I can imagine that between the time a
page class is constructed and when the page is displayed, there
might be changes that have to be made. Where could this code be
placed?
For example, the Pro Wicket book (around page 32) has an example of
a Login and a Welcome page. The Welcome page constructor takes a
reference to Login.this, so that a link back to the Login page
takes you back to the same instance of the Login page. In this
scenario, when the link is clicked and the response page is set to
the existing Login page, where is the opportunity to change the
Login page, if required? In Struts I would have the Struts action.
Here, I'm not so sure.
Thanks for any info.
Will
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]