• 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: Sub Components, Bindings and Intialisation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sub Components, Bindings and Intialisation


  • Subject: Re: Sub Components, Bindings and Intialisation
  • From: Owen McKerrow <email@hidden>
  • Date: Thu, 11 Nov 2004 15:27:53 +1100

Hi All,

I added a boolean to the class called firstTime, in the constructor I set it to true. Then inside the awake method I check if firstTime is true, if so, set it to false( so it only executes the first time the page is loaded ) and then call pullValuesFromParent() then continue with my other code ( i.e. I shifted it all down form the constructor to inside awake )

Owen

On 11/11/2004, at 2:40 PM, Owen McKerrow wrote:

Hi All,

Im trying to figure out exactly how Sub-components work, in particular the bindings API stuff.
Lets say I wanted to make a sub-component that given a class name, fetch's all entries for that class and displays it in a WORepition. So I would set up a variable className of type String which I would then set as a binding for this Sub-Component through the API editor. I drop the component into the parent component and bind className binding to the name of the class, lets say in this case Member.
Now I would have though that back over in the Sub-Components constructor I would have just been able to use className, say for getting all objects from the database of the Entity who's name was passed in
e.g.


objcectList = EOUtilities.objectsForEntityNamed(ec,className);

Where objectsList is the array I use with my repetition.

However it appears to me that the className variable doesn't get set until after the component has initialized. This being the case how do I then execute code that this dependent on the bindings after the constructor has been called but before the response is sent ?
i.e. how do I get the the component to get the objects from the database if className is not set until after the constructor has been called ?


Thanks
Owen



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
People who prefer typing to pointing then seem to prefer acronyms to save typing :-)
-Denis Stanton, On people using Command Line Interfaces


_______________________________________________
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


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"I like the way this project has somehow, against all common sense, got itself made."
- Peter Jackson, "The Lord of The Rings"


_______________________________________________
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


References: 
 >Sub Components, Bindings and Intialisation (From: Owen McKerrow <email@hidden>)

  • Prev by Date: Sub Components, Bindings and Intialisation
  • Next by Date: Re: PostgreSQL Adaptor and Plugin
  • Previous by thread: Sub Components, Bindings and Intialisation
  • Next by thread: WO stocked anywhere?
  • Index(es):
    • Date
    • Thread