• 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: passing object to component problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: passing object to component problem
      • From: Theodore Petrosky <email@hidden>
References: 
 >passing object to component problem (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: passing object to component problem
  • Next by Date: Re: Invalidating objects asynchronously + Terracotta + Groovy
  • Previous by thread: passing object to component problem
  • Next by thread: Re: passing object to component problem
  • Index(es):
    • Date
    • Thread