Re: Can't understand what is form rewinding.

Eric Everman <[email protected]> Fri, 21 Feb 2003 11:18:19 -0600
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
Tarun-

I can take a stab at that question.

Form rewinding is the process of recreating the same conditions during form 
submit, that a particular component saw during form render.

For rewinding is key in understanding iterative form components.  For 
instance, say you have an arbitrary list of items with 'edit' and 'delete' 
buttons next to each item.  Your template might look something like this 
(in pseudo code)

<for each item>
<insert item name/><create edit button/><create delete button/>
</for each item>

All the delete buttons call the delete() method, but do not specify which 
item to delete.  When the user clicks a 'Delete' button, the conditions 
that the form saw when the button were rendered are recreated - that is, if 
your page had a currentItem property, that property is reset to the 
currentItem when the button was rendered.  Your delete method is called by 
Tapestry and your code deletes the item in currentItem, know that it is the 
correct item.

This is all optional and not ideal in some cases.  You can use the Direct 
service, which puts the burden on you to give actions a meaningful 
identifier by which you can locate the correct item to act on.

Does that help?

Eric Everman

At 2/21/2003, Elankath, Tarun (Cognizant) wrote:
>Hi list,
>
>Sorry for this newbie-style question. I have read the tutorial and the user
>manual. I understand the advantages that Tapestry offers, but its complexity
>is mind-boggling. I have been just totally unable to understand what is form
>rewinding/rewind cycle and its principle.
>
>Could someone please explain what rewind is ?
>
>All help/pointers gratefully appreciated,
>Tarun
>



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge