• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting a DirectAction URL to a method or Variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Fri, 24 Jan 2003 01:38:47 +0000

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
_______________________________________________
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.

  • Prev by Date: Webobjects deployed on Tomcat
  • Next by Date: Re: Refreshing a Page
  • Previous by thread: Getting a DirectAction URL to a method or Variable
  • Next by thread: Re: Getting a DirectAction URL to a method or Variable
  • Index(es):
    • Date
    • Thread