Re: Returning previously instantiated Main page
Re: Returning previously instantiated Main page
- Subject: Re: Returning previously instantiated Main page
- From: Chuck Hill <email@hidden>
- Date: Fri, 13 Mar 2009 23:30:29 -0700
Hi Klaus,
On Mar 13, 2009, at 8:50 PM, Klaus Berkling wrote:
Hi All.
This is probably something obvious (or obviously wrong way of doing
it).
I have my Main page, a user logs in and stuff changes on that page.
The user navigates to another page, something gets done there and I
return to the Main page with "return pageWithName()". Problem is
that "return pageWithName()" creates another instance of the Main
page. I need my previously instantiated page.
I get the context ID of the Main page using
this.context().contextID() before I go to the second page.
Then I tried this when I finish with the second page:
return session().restorePageForContextID(returnToPageWithThisContext);
This returns null, going back to the second page.
How do I get my previously instantiated Main page back? (there is no
browser back link, I need to do this in the code)
Thanks for any ideas (or the 'duh' solution).
This is what do in the class that I use for the super class for pages
that need to go back:
public abstract class PageWithPreviousPage extends WOComponent {
private WOComponent previousPage;
public PageWithPreviousPage(WOContext context) {
super(context);
previousPage = context.page();
}
public WOComponent previousPage() {
previousPage._awakeInContext(context());
return previousPage;
}
Then you can just say return previousPage() to go back
Chuck
kib
"The trouble with normal is it always gets worse."
Bruce Cockburn
Truth!
Klaus Berkling
Systems Administrator
DynEd International, Inc.
www.dyned.com | www.eskimo.com/~kiberkli
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden