Re: Can't understand what is form rewinding.

"Ahmed Aly" <[email protected]> Fri, 21 Feb 2003 14:19:57 -0500
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
<html><div style='background-color:'><DIV>
<P>Hi all,</P>
<P>While we're on the subject of form rewinding...in my application, when the form rewinds all PropertySelection&nbsp;&nbsp;compnents doesn't&nbsp;select (add SELECTED attribute to OPTION elements) the previously selected value when the form was submitted.&nbsp;&nbsp;I tried&nbsp;implementing&nbsp;a custom PropertySelectionRenderer but in renderOption(...) , &lt; obj &gt; parameter is always n null.&nbsp;&nbsp;Any ideas on how to preserve the selected value???</P></DIV>
<DIV>-Ahmed</DIV>
<DIV>&nbsp;</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>&gt;From: Eric Everman <[email protected]>
<DIV></DIV>&gt;To: "Elankath, Tarun (Cognizant)" <[email protected]>, [email protected] 
<DIV></DIV>&gt;Subject: Re: [Tapestry-developer] Can't understand what is form rewinding. 
<DIV></DIV>&gt;Date: Fri, 21 Feb 2003 11:18:19 -0600 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Tarun- 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;I can take a stab at that question. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Form rewinding is the process of recreating the same conditions 
<DIV></DIV>&gt;during form submit, that a particular component saw during form 
<DIV></DIV>&gt;render. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;For rewinding is key in understanding iterative form components. 
<DIV></DIV>&gt;For instance, say you have an arbitrary list of items with 'edit' 
<DIV></DIV>&gt;and 'delete' buttons next to each item. Your template might look 
<DIV></DIV>&gt;something like this (in pseudo code) 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;<FOR item each> 
<DIV></DIV>&gt;<INSERT item name /><CREATE button edit /><CREATE button delete /> 
<DIV></DIV>&gt;</FOR item each> 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;All the delete buttons call the delete() method, but do not specify 
<DIV></DIV>&gt;which item to delete. When the user clicks a 'Delete' button, the 
<DIV></DIV>&gt;conditions that the form saw when the button were rendered are 
<DIV></DIV>&gt;recreated - that is, if your page had a currentItem property, that 
<DIV></DIV>&gt;property is reset to the currentItem when the button was rendered. 
<DIV></DIV>&gt;Your delete method is called by Tapestry and your code deletes the 
<DIV></DIV>&gt;item in currentItem, know that it is the correct item. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;This is all optional and not ideal in some cases. You can use the 
<DIV></DIV>&gt;Direct service, which puts the burden on you to give actions a 
<DIV></DIV>&gt;meaningful identifier by which you can locate the correct item to 
<DIV></DIV>&gt;act on. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Does that help? 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Eric Everman 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;At 2/21/2003, Elankath, Tarun (Cognizant) wrote: 
<DIV></DIV>&gt;&gt;Hi list, 
<DIV></DIV>&gt;&gt; 
<DIV></DIV>&gt;&gt;Sorry for this newbie-style question. I have read the tutorial and 
<DIV></DIV>&gt;&gt;the user 
<DIV></DIV>&gt;&gt;manual. I understand the advantages that Tapestry offers, but its 
<DIV></DIV>&gt;&gt;complexity 
<DIV></DIV>&gt;&gt;is mind-boggling. I have been just totally unable to understand 
<DIV></DIV>&gt;&gt;what is form 
<DIV></DIV>&gt;&gt;rewinding/rewind cycle and its principle. 
<DIV></DIV>&gt;&gt; 
<DIV></DIV>&gt;&gt;Could someone please explain what rewind is ? 
<DIV></DIV>&gt;&gt; 
<DIV></DIV>&gt;&gt;All help/pointers gratefully appreciated, 
<DIV></DIV>&gt;&gt;Tarun 
<DIV></DIV>&gt;&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;------------------------------------------------------- 
<DIV></DIV>&gt;This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. 
<DIV></DIV>&gt;The most comprehensive and flexible code editor you can use. 
<DIV></DIV>&gt;Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day 
<DIV></DIV>&gt;Trial. 
<DIV></DIV>&gt;www.slickedit.com/sourceforge 
<DIV></DIV>&gt;_______________________________________________ 
<DIV></DIV>&gt;Tapestry-developer mailing list 
<DIV></DIV>&gt;[email protected] 
<DIV></DIV>&gt;https://lists.sourceforge.net/lists/listinfo/tapestry-developer 
<DIV></DIV></div><br clear=all><hr>MSN 8 with <a href="http://g.msn.com/8HMFENUS/2740">e-mail virus protection service: </a> 2 months FREE*</html>


-------------------------------------------------------
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