You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhariz Jabeer <mu...@gmail.com> on 2005/06/16 20:48:01 UTC

Method in component class being called without manual invokation

hi guys, I have a custom component which iterates over a collection class to 
dynamically
generate fields in a table using ListEditMap and ListEdit. I have a method 
called 
"adMore" which is to be triggered by a click to a Submit button in the 
component. 
Its purpose is to post to the server, a request to add one more item to the 
collection class. Which in turn should make the ListEdit component in my 
custom
component draw an aditional field in the table.

The Problem:
The "addMore" method keeps getting called when the page loads. This ends up 
adding more fields to my collection
class thus inturn draws more fields than i wanted. I checked the server log 
(i use stdout in the AddMore method)
and it gets called when the page loads even before i click the submit button 
in the component which is
supposed to call the method.


any ideas whats going on?




-- 
In a long enough timeline,
every moment will feel like deja vu.
-Muhariz.

Re: Method in component class being called without manual invokation

Posted by Ron Piterman <mp...@vollbio.de>.
call it from inside a listener method. then set the listener attribute 
of your submit button/link to call this listener method.


ציטוט Muhariz Jabeer:
> hi guys, I have a custom component which iterates over a collection class to 
> dynamically
> generate fields in a table using ListEditMap and ListEdit. I have a method 
> called 
> "adMore" which is to be triggered by a click to a Submit button in the 
> component. 
> Its purpose is to post to the server, a request to add one more item to the 
> collection class. Which in turn should make the ListEdit component in my 
> custom
> component draw an aditional field in the table.
> 
> The Problem:
> The "addMore" method keeps getting called when the page loads. This ends up 
> adding more fields to my collection
> class thus inturn draws more fields than i wanted. I checked the server log 
> (i use stdout in the AddMore method)
> and it gets called when the page loads even before i click the submit button 
> in the component which is
> supposed to call the method.
> 
> 
> any ideas whats going on?
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org