Create an interface that consists of "setDateRange", and put "implements" on all the pages, cast them to the interface type, and you're done.

On Sep 14, 2006, at 2:02 PM, Scott Winn wrote:

Hello all, 

I'm trying to share data between two kinds of WOComponents.  They are separate pages for all practical intents.  The first kind is a page that needs a date range set, the second is a calendar that sets the dates one at a time.  Click the Start Date link tells the Calendar Component that I'm going to be picking a start date and sends a DateRange object to be set.  

public CSSCalendar getCalendar() {
CSSCalendar nextPage = (CSSCalendar)pageWithName("CSSCalendar");

nextPage.setDateRange(dateRange);
nextPage.setDateType("Start");
nextPage.setParentPage(this);

   return nextPage;
}

So far so good.  The problem is since the Calendar is going to be called by lots of different Components I don't know how to send the DateRange back to the calling Component.  

public WOComponent returnToParentPage() {

parent.setDateRange(dateRange); // <--- problem

return parent;
}

The compiler doesn't like the setDateRange call and I don't blame it, but I don't know the right way to do it.  Obviously, I could put the DateRange in the session, but I'm trying to avoid that.  Do I need to make everything that wants to get a value back from the Calendar a subclass of Calendar?  

Obviously I'm new to Java and WebObjects.  Thanks for the help.

Scott
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to