"Jakarta Commons Users List" <[EMAIL PROTECTED]> writes:
>The simplest way for a child tag object to obtain its parent tag object is
> DynamicBeanTag parentTag = (DynamicBeanTag) getParent();
> Object parentBean = parentTag.getBean();
> // At this point a cast is necessary to do anything useful will
>parentBean.
This certainly works and I "discovered" this solution myself. Can't say if
it's the simplest or most elegant, though.
>
>Parent tag objects cannot, in their doTag method, locate their child tag
>objects and invoke methods on them to "pull" data up. I'm really hoping,
>I'm wrong about this.
If you have the children can push themselves to the parent during
invokeBody(...), then the parent can process them after the call to
invokeBody(...), no?
// parent code:
public void doTag(XMLOutput output) throws Exception {
invokeBody(output); // children push themselves up...
processChildren(); // iterate over children doing whatever
}
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]