This is quick and dirty but works really well.

/** Returns the root parent component for this component. The root component
* is the component whose parent is null.  If this is the root component
* then this method returns 'this'.
* @return The root parent component.
*/
public WOComponent rootComponent() {
WOComponent c = this;
while(c.parent() != null) c = c.parent();
return c;
}

--
Galen Rhodes


On Dec 8, 2005, at 6:21 PM, Miguel Arroz wrote:

Hi!

  When working in a method of a sub-component, is there a straightforward way to get the top level component (assuming that there is more that one component level, so that the component's parent() is also not the top level one)?

  Yours

Miguel Arroz

      "GUERRA E' PAZ
       LIBERDADE E' ESCRAVIDAO
       IGNORANCIA E' FORCA"       -- 1984

Miguel Arroz



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to