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 |