You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ro...@anitefinance.com on 2003/08/07 14:43:52 UTC

getBeans called within renderComponent within AbstractFormCompone nt subclass

I have copied the Submit component with the intention of providing some
modified functionality.

Within the "renderComponent" method of the "Submit.java" is the following
code snipit

....
IActionListener listener = getListener();
            
if (listener != null)
listener.actionTriggered(this, cycle);
....

To cut a long story short  I have replaced the above code with a call to
"getBeans". However this is returning me an empty collection. 

However if I re-instate the listener then calls to "getBeans" within the
listener method return all the beans I expect.

My design for this component relies on having access to the beans within the
page or other enclosing component. 

Any ideas or explanations would be most gratefully received.


Thanks
Robert Stevenson

RE: getBeans called within renderComponent within AbstractFormComponent subclass

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Do you define any beans in your CustomSubmit component?

Perhaps you want to invoke getContainer().getBeans().

Why don't you create a bean that implements IActionListener and just set that as the listener for
the existing Submit component?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Robert.Stevenson@anitefinance.com 
> [mailto:Robert.Stevenson@anitefinance.com] 
> Sent: Thursday, August 07, 2003 8:44 AM
> To: tapestry-user@jakarta.apache.org
> Subject: getBeans called within renderComponent within 
> AbstractFormComponent subclass
> 
> 
> I have copied the Submit component with the intention of 
> providing some modified functionality.
> 
> Within the "renderComponent" method of the "Submit.java" is 
> the following code snipit
> 
> ....
> IActionListener listener = getListener();
>             
> if (listener != null)
> listener.actionTriggered(this, cycle);
> ....
> 
> To cut a long story short  I have replaced the above code 
> with a call to "getBeans". However this is returning me an 
> empty collection. 
> 
> However if I re-instate the listener then calls to "getBeans" 
> within the listener method return all the beans I expect.
> 
> My design for this component relies on having access to the 
> beans within the page or other enclosing component. 
> 
> Any ideas or explanations would be most gratefully received.
> 
> 
> Thanks
> Robert Stevenson
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>