Re: passing object to component problem
Re: passing object to component problem
- Subject: Re: passing object to component problem
- From: David LeBer <email@hidden>
- Date: Wed, 3 Sep 2008 10:06:56 -0400
On 3-Sep-08, at 9:49 AM, Theodore Petrosky wrote:
I have a component that displays Asset objects. These Assets are a
to one relation with Manufacturers (one Manufacture many assets).
I am trying to learn how to include a new component so I added:
<wo:NewAsset />
where NewAsset is a new stateless component. The new component works
fine. but I am at a loss how to pass to it an object. I tried:
You say stateless, but is it synchronizing or non?
<wo:NewAsset workingManufacturer = "$selectedManufacturer"/>
where there are both setters and getters in NewAsset for
workingManufacturer (workingManufacturer and
setWorkingManufacturer). selectedManufacturer is the accessor for
the Manufacturer selected from a popup. I have an NSLog statement in
the getter and indeed it returns the correct selected Manufacturer.
So I want NewAsset's workingManufacturer to be passed this object. I
have even tried:
<wo:NewAsset setWorkingManufacturer = "$selectedManufacturer"/>
and the setter in never called. I think it has something to do the
the Form.... however if I extend the WOForm to include this
component, I get the following error:
er.extensions.components._private.ERXWOForm - This form is embedded
inside another form, so the inner form is being omitted:
<er.extensions.components._private.ERXWOForm action: null
actionClass: null directActionName: null href: null multipleSubmit:
null queryDictionary: null otherQueryAssociations: null >
How do I pass this value in to the component?
If the component is non-synchronizing you will need to manually obtain
the values for your workingManufacturer:
Something like:
public Manufacturer workingManufacturer() {
if (_workingManufacturer == null) {
_workingManufacturer =
(Manufacturer)valueForBinding("workingManufacturer");
}
return _workingManufacturer;
}
and clear out the value in reset:
public void reset() {
_workingManufacturer = null;
}
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
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