• 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: Access to a surrounding component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Access to a surrounding component


  • Subject: Re: Access to a surrounding component
  • From: Stefan Klein <email@hidden>
  • Date: Tue, 28 Sep 2010 22:44:52 +0200

 Thanx Timo for your detailed answer,

but that's not what I'm looking for.

Just another try:

I had a component comp1 that is embed in a page.
comp1 has other components in it and one of them is a WOComponentContent.
In that WOComponentContent i placed some other components.

What I tried is to get access to comp1 from the inner components to read some computed values from comp1.

Using parent() brings me up one level to high.

Stefan

Am 28.09.10 22:37, schrieb Timo Hoepfner:
Hi Stefan,

consider passing the relevant vars/actions via bindings. Relying on a certain component structure will get into your way sooner or later.

That being said, WOComponent#parent() might be what you're looking for:

<http://developer.apple.com/legacy/mac/library/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/appserver/WOComponent.html#parent()>

Depending on what you want to do, WOComponent#performParentAction might also be useful:

<http://developer.apple.com/legacy/mac/library/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/appserver/WOComponent.html#performParentAction(java.lang.String)>

And when you don't want the actual parent, but the page level component, use WOComponent#context().page()...

<http://developer.apple.com/legacy/mac/library/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/appserver/WOComponent.html#context()>
<http://developer.apple.com/legacy/mac/library/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/appserver/WOContext.html#page()>

HTH,

Timo


Am 28.09.2010 um 22:24 schrieb Stefan Klein:

Hi,

is there anyway to access the surrounding component.

Example :

<wo: comp1>
<wo comp2 />
</wo>

Is there anyway for comp2 to find com1 ?

Stefan
_______________________________________________
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

_______________________________________________
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: 
 >Access to a surrounding component (From: Stefan Klein <email@hidden>)
 >Re: Access to a surrounding component (From: Timo Hoepfner <email@hidden>)

  • Prev by Date: Surveys closing date
  • Next by Date: Re: Access to a surrounding component
  • Previous by thread: Re: Access to a surrounding component
  • Next by thread: Surveys closing date
  • Index(es):
    • Date
    • Thread