That said, I hardly use this pattern anywhere else. Normally, I design my pages so that they know enough on construction time, and that I just can create new instances when I want to navigate to them. Usually, an IModel argument suffices.
I your case - the wizzard, you could hide your navigations using some kind of action pattern. E.g.
public interface INavigationAction
{
void navigate(RequestCycle requestCycle, WizzardState state);
}or keep the wizzard state in the (type safe) session.
B.t.w, I've been thinking a bit about a wizzard component as well, but unfortunately had no time to finish it. If I do sometime soon, I'll commit it in the examples project.
Good luck,
Eelco
Matthew Watson wrote:
Hi Eelco,
In the example you've included, where did you define the searchCDPage?
add(new Link("cancelButton")
{
public void onClick()
{
// put search page in front of the queue again
searchCDPage.getPageMap().put(searchCDPage);
setResponsePage(searchCDPage);
}
});
Is that something you pass into the current page? The reason I'm asking is that I'm trying to write a complicated wizard that has many ways of moving between pages and I want to avoid having to pass all that possible pages in each time.
Thanks, Matt
[EMAIL PROTECTED] 05/20/05 03:19a.m. >>>
Hah, that's funny. Seems that this was a bug in MostRecentlyUsedMap all
the time. From HEAD/ 1.0 rc3, you shouldn't have to use this hack anymore, as the map is allways updated automatically.
Eelco
Eelco Hillenius wrote:
Hi,
There is a simple trick you can use. It's a bit of a hack maybe, but
it works:
add(new Link("cancelButton") { public void onClick() { // put search page in front of the queue again searchCDPage.getPageMap().put(searchCDPage); setResponsePage(searchCDPage); } });
Here, searchCDPage is the page object I reuse. The trick is here that
when you want to reuse it, you have to put it at front of the list of
out!pages that are in the session.
Btw, The pages are stored in wicket.util.collections.MostRecentlyUsedMap, which is one of the coolest examples of the JDK's collections framework IMO. Check it
Good luck,
Eelco
Matej Knopp wrote:
Hi
I know it's been discussed here already, but still I coudln't find a
linksolution.
The problem is that I've a detail page from which I want to have
to master page. The link is done like this:
add (new PageLink ("back", new IPageLink () { public Page getPage () { return back; } public Class getPageIdentity () { return back.getClass (); } }));
back contains reference to master page. The problem is that master's
page always expires after 10 detail pages are rendered.
How can I (if there is a way) move the page to the front of session
topages (so that other pages would expire sooner)?
Recreating master page using BookmarkableLink is not a solution, since I need the master page remember it's state.
Thanks -Matej Knopp
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play
towin an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________
Wicket-user mailing list
[email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________
Wicket-user mailing list
[email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________
Wicket-user mailing list
[email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
********************************************************************************
This email may contain legally privileged information and is intended only for the addressee. It is not necessarily the official view or communication of the New Zealand Qualifications Authority. If you are not the intended recipient you must not use, disclose, copy or distribute this email or information in it. If you have received this email in error, please contact the sender immediately. NZQA does not accept any liability for changes made to this email or attachments after sending by NZQA.
All emails have been scanned for viruses and content by MailMarshal. NZQA reserves the right to monitor all email communications through its network.
********************************************************************************
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
