Re: Getting a DirectAction URL to a method or Variable
Re: Getting a DirectAction URL to a method or Variable
- Subject: Re: Getting a DirectAction URL to a method or Variable
- From: "Jonathan Fleming" <email@hidden>
- Date: Wed, 29 Jan 2003 00:36:38 +0000
How do I get this to work when using WODirectActions? I can see that you can
use WOComponent in directAction, but I can't use the set and get methods in
the directAction, so how to I get to the value of the instance variable that
was set in the "details" page to get back to the "results" page?
Regards
Jonathan
From: Seejo Pylappan <email@hidden>
To: "Jonathan Fleming" <email@hidden>
Subject: Re: Getting a DirectAction URL to a method or Variable
Date: Fri, 24 Jan 2003 06:44:38 -0500
It is essentially the same, except for variablenames which I think is not a
good choice.
On Thursday, January 23, 2003, at 08:38 PM, Jonathan Fleming wrote:
Yes Radwar,
your deduction of what I want to do is absolutly right, however, I won't
be able to check this out for a few days as I'm away but I'll let you know
how I get on after the weekend.
In the meantime here is an example I got from Latha on the list (would
this do the same thing or is it better ?):
Let us assume that you have 2 pages Page1 & Page2
================================================
In Page1
Before passing the control to page2
Page2 nextPage = (Page2)pageWithName("Page2");
nextPage.setMyContext(context().page());
return nextPage;
=====================================================
In Page2
Declare a variable named myContext of type WOComponent and provide set and
get methods for the variable
protected WOComponent myContext;
From the method where you want to go back to Page1
return myContext;
=======================================================
Please note that the return type fo this method should be WOComponent
Hope this helps
Latha
Thanks
Jonathan
From: Radwar <email@hidden>
To: "Jonathan Fleming" <email@hidden>
Subject: Re: Getting a DirectAction URL to a method or Variable
Date: Wed, 22 Jan 2003 11:00:21 -0500
On Wednesday, January 22, 2003, at 10:37 AM, Jonathan Fleming wrote:
How do I go about getting the URL of my loaded page into a method or
instance variable so that I can use it to go back to a results page, for
instance after view a spacific ID/record from the database?
Not sure I understand correctly. But are you talking about Page
navigation here? Like you have a page which shows Employees and click on
one of the Employee which brings up the Employee detail page and then you
want to go back to the Employee results page? Well you can have an ivar
in the detail page which you set when you traverse to that page and once
you are done in the detail page you click a button which is bound to a
method which returns the ivar:
eg:
in Results.java
public WOComponent showEmployeeDetail() {
EmployeeDetail nextPage =
(EmployeeDetail)pageWithName("EmployeeDetail");
nextPage.setPreviousPage(this);
return nextPage;
}
and in EmployeeDetail.java
protected previousPage;
// set method
// this returns the prev page.
public WOComponent showResultaPage {
return previousPage;
}
_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://messenger.msn.co.uk
_________________________________________________________________
Worried what your kids see online? Protect them better with MSN 8
http://join.msn.com/?page=features/parental&pgmarket=en-gb&XAPID=186&DI=1059
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.