The Foreach that wraps around the Submit will set a property of the page to the first value in its list, then render its body (including the Submit). The Foreach then sets the property to the second value, renders its body, etc.
This happens when the page is initially renderred. The magic and mystery of Tapestry, is that it happens again when the form is submitted ... that's because processing a form submission involves a "mock" render phase (the "rewind" phase) that walks in the footsteps of the original, real render (in the previous request cycle). So, inside your Submit component's listener, you can check that very same page property to figure out where you are in the Foreach's list. -- [EMAIL PROTECTED] http://tapestry.sf.net > Thanks for your reply. > > I have another question about listener. The Submit components are generated by > Foreach component. I'd like to set the identical listener to these submit > components. But I do not know how to set parameter to the listener, i.e. how the > listener can identify which submit button was pushed. > ----- Original Message ----- > From: Howard M. Lewis Ship > To: tapestry-developer > Sent: Thursday, September 19, 2002 7:06 PM > Subject: Re: [Tapestry-developer] question about binding > > > Form components respond to the submission in the order that they render. It > looks like your Submit component renders before your PropertySelection > component, therefore the Submit's listener is notified before the > PropertySelection gets a chance. > > You may want to have the Submit component's listener just set a flag, and have > the Form's listener (which is notified dead last), perform whatever operation is > appropriate. > ----- Original Message ----- > From: xuzhou > To: tapestry-developer > Sent: Wednesday, September 18, 2002 11:33 PM > Subject: [Tapestry-developer] question about binding > > > Hi all, > > I use Form to developer my own component. There are one Submit and one > PropertySelection in this form. The submit has its listener and the > propertySelection's value is bound to property path(it's java class's field). In > listener, there are codes to modify this field. > > When the submit button is pushed, i found the listener mothod is executed > firstly, then the property path is bound, i.e. this field value is modifidy by > the listener firstly, then by the binding mechanism. I think the property path > should be bound firstly. I am not sure whether the tapestry's problem or i make > some mistakes. > > Thanks. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Tapestry-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/tapestry-developer
