[Solved]: How to get sub-component data up to parent
[Solved]: How to get sub-component data up to parent
- Subject: [Solved]: How to get sub-component data up to parent
- From: Baiss Eric Magnusson <email@hidden>
- Date: Thu, 6 Mar 2008 18:52:04 -0800
I put
setValueForBinding( mdyValue, "mdyValue");
into the sub-component and success.
On Mar 6, 2008, at 5:17 PM, Chuck Hill wrote:
On Mar 6, 2008, at 5:12 PM, Baiss Eric Magnusson wrote:
Chuck, after getting rid of some code in Awake I find I'm not
getting the value of the sub-component binding back up to the
parent, which was I believe my original problem a while back and
the reason for the unusual code, in trying to be straightforward I
now have:
In sub-component <MonthDayYear.java>
public NSTimestamp mdyValue;
void rtrnDateFromPopups() {
gc.set( Calendar.YEAR, yearNum.intValue() )
...
mdyValue = new NSTimestamp( gc.getTime() );// this is correct at
this point
pushValuesToParent(); // this seems to have no affect anymore
You should not have that.
}
public void takeValuesFromRequest( WORequest aRequest, WOContext
aContext) {
// Assuming that you do want the data from the form...
super.takeValuesFromRequest(aRequest, aContext);
rtrnDateFromPopups();
}
In <EnterEvent.java> file in the Action method of the Submit:
editDate = (NSTimestamp)valueForBinding("mdyValue"); which
returns null,
Yes, I would expect that to return null. That is getting the
parent of EnterEvent's vlaue for mdyValue. Parent's don't ask
their children for values.
// if I don't set <editDate> it has the original parent date.
Without the call to super.takeValues, I would expect that.
Bindings in <EnterEvent.wo> file:
EditMDY: MonthDayYear {
mdyValue = editOldDate;
}
MonthDayYear: MonthDayYear {
mdyValue = editDate;
}
Chuck
--
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
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
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