Hi, Some background first: In WebObjects, each request/response loop has 3 phases - takeValues, invokeAction, appendToResponse.
In Tapestry, there is two phases - rewind and render. Rewind does both takeValues and invokeAction, and render is the equiv of appendToResponse. I have a situation where I want to do something in the action listener of a submit button, that will modify the number of items in the rest of the form. Thus, I get stale link exceptions. I can get around it by being canny about when I update the data returned from my model (basically cache it until the form listener is called then refetch the updated values in time for the render). But that feels like a hack. I could use the selected/tag bindings of Submit, but then the form listener has to be a "switch" to figure out which button was pressed and call the right method. That's kinda what I figured submit listeners were for. The other time this might be a problem (and this is theoretical, but not inconceivable) is if a submit button was physically partway through a Form, in the HTML. The listener wouldn't have access to all the form values when it is invoked, because some form elements (those physically "after" the submit button) have not been rewound yet. Yes, this is all documented (which is a huge step up over WebObjects :-)), but it doesn't quite gel to me. What is the intended use of Submit listeners, if they can't do anything to modify anything related to the form for fear of modifying the elementCount of the form and getting StaleLinkExceptions? More to the point, do I really have to use selected/tag on Submit and make my form listener a switch? Ta, Craig Miskell Programmer, Black Albatross, Otago University, New Zealand -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d- s+:- a-->? C++++(++)$ ULXH+++$>++++ P+>++++ L++$>++++$ E--- W+++$ N+ K? w--- !O M-- V? PS--- PE Y t++ 5 X+++ R-- tv+ b+>+++ DI++++ D+ G+ e++ h--- r+++ y+++ ------END GEEK CODE BLOCK------ ------------------------------------------------------- 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
