tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Byrne, Steven" <SBy...@dorado.com>
Subject RE: Rewind Usage
Date Wed, 27 Aug 2003 01:46:24 GMT
Yes, it very much does explain things.  Thank you!  I believe I even
have some insight as to how the rewind process works now, what the docs
were saying about replaying interated content etc., much like the old
XDR system could serialize and deserialize the same data structures with
the same set of code. 

I do think the name is very confusing, pending book or no pending book.


> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net] 
> Sent: Tuesday, August 26, 2003 2:15 PM
> To: Tapestry users
> Subject: Re: Rewind Usage
> 
> 
> Let me try and explain this with a simple example. Let's 
> suppose we have 
> a form that has a text field that is used for updating some 
> user name in 
> the database. Let's suppose we use the TextField component to 
> accomplish 
> the task. Let's suppose the user name from the database is 
> stored in a 
> "User" bean in an attribute "userName". Let's suppose the 
> "User" bean is 
> stored in the page class. Now, when the page is rendered 
> (render phase), 
> the user name is read from the "userName" attribute in the 
> "User" bean 
> and diplayed in the text field in the form. When the form is 
> submitted 
> (rewind phase), the value in the text field in the form is read and 
> stored in the "userName" attribute in the "User" bean held in 
> the page 
> class. That is the whole purpose of the rewind. Hope this 
> clarifies things.
> 
> -Harish
> 
> Byrne, Steven wrote:
> 
> >Sorry to be pedantic, but I am confused about the "form values are
> >updated [back to the properties] bound to the components" 
> part.   I want
> >to interpret it as "form values are STORED INTO the 
> properties stored 
> >in the components", but the way you've written it sounds 
> like [and the 
> >term "rewind" certainly seems to suggest] the form values are being 
> >*reset* to some value, which, from the docs I've read, seems 
> to be the 
> >sense of what rewinding is about, that the rewinding is somehow 
> >preparing the form values for use in the next rendering.
> >
> >Can you phrase what you've said a little differently so it's clear 
> >exactly what's going on?
> >
> >  
> >
> >>-----Original Message-----
> >>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> >>Sent: Tuesday, August 26, 2003 11:39 AM
> >>To: Tapestry users
> >>Subject: Re: Rewind Usage
> >>
> >>
> >>Rewind in Tapestry is the process of reversing the render.
> >>When a page 
> >>is rendered, form values are updated from the properties 
> bound to the 
> >>components and when the page is submitted (rewound) the form 
> >>values are 
> >>updated back to the properties bound to the components (the exact 
> >>reverse process of the render).
> >>
> >>-Harish
> >>
> >>PS. Did I steal Howard's chance? ;)
> >>
> >>James Hays wrote:
> >>
> >>    
> >>
> >>>Yes, your suggestion makes perfect sense.  I was planning
> >>>      
> >>>
> >>on doing it
> >>    
> >>
> >>>that way to hide the visit if I couldn't find a better way 
> to do it.
> >>>
> >>>Rewind to me means to back up or reverse the process.  So, I had 
> >>>assumed that it meant that it would revert my form objects back to 
> >>>their state before the form was submited. Howard, can you clarify 
> >>>this?  Is it possible to call a
> >>>      
> >>>
> >>listener on a
> >>    
> >>
> >>>form without the setters being called first?
> >>>
> >>>James
> >>>
> >>>Harish Krishnaswamy wrote:
> >>>
> >>>      
> >>>
> >>>>I am afraid that's not the purpose of rewind. The rewind, as I 
> >>>>understand it, is basically a mechanism of grabbing the
> >>>>        
> >>>>
> >>data in the
> >>    
> >>
> >>>>form and setting it in the objects bound to the form
> >>>>        
> >>>>
> >>components. The
> >>    
> >>
> >>>>way I would handle your situation is, set a property when
> >>>>        
> >>>>
> >>"cancel" is
> >>    
> >>
> >>>>pressed and use this property to determine when to update
> >>>>        
> >>>>
> >>the Visit.
> >>    
> >>
> >>>>This may need some synthetic properties in your page as a
> >>>>        
> >>>>
> >>temporary
> >>    
> >>
> >>>>storage for your form values. Let me know if this not 
> clear enough.
> >>>>
> >>>>-Harish
> >>>>
> >>>>James Hays wrote:
> >>>>
> >>>>        
> >>>>
> >>>>>Does anyone have an example of using Tapestry's rewind
> >>>>>          
> >>>>>
> >>feature on a
> >>    
> >>
> >>>>>component or a page?
> >>>>>
> >>>>>The problem I'm trying to solve is with a cancel button.  I am 
> >>>>>currently setting a submit component with a listener that
> >>>>>          
> >>>>>
> >>goes to a
> >>    
> >>
> >>>>>predetermined page.  The components on this page link to
> >>>>>          
> >>>>>
> >>the visit
> >>    
> >>
> >>>>>object directly, so when the form submits, my visit object is
> >>>>>modified.  If I choose to cancel this form, I need a way 
> >>>>>          
> >>>>>
> >>to 'rewind'
> >>    
> >>
> >>>>>the form and get my old values back?  I'm assuming this is the
> >>>>>purpose of the rewind feature, but I'm not 100% sure as 
> >>>>>          
> >>>>>
> >>I've found
> >>    
> >>
> >>>>>little documentation or conversation about it in this list.
> >>>>>
> >>>>>If you have any thoughts on this problem please let me 
> know or if 
> >>>>>you could point me in the right direction, it would be most 
> >>>>>appreciated.
> >>>>>
> >>>>>Thanks,
> >>>>>
> >>>>>James Hays
> >>>>>
> >>>>>
> >>>>>
> >>>>>          
> >>>>>
> >>--------------------------------------------------------------------
> >>    
> >>
> >>>>>-
> >>>>>To unsubscribe, e-mail:
> >>>>>          
> >>>>>
> >>tapestry-user-unsubscribe@jakarta.apache.org
> >>    
> >>
> >>>>>For additional commands, e-mail:
> >>>>>          
> >>>>>
> >>tapestry-user-help@jakarta.apache.org
> >>    
> >>
> >>>>>          
> >>>>>
> >>>>
> >>>>        
> >>>>
> >>------------------------------------------------------------
> ---------
> >>    
> >>
> >>>>To unsubscribe, e-mail:
> >>>>        
> >>>>
> >>tapestry-user-unsubscribe@jakarta.apache.org
> >>    
> >>
> >>>>For additional commands, e-mail:
> >>>>tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>        
> >>>>
> >>>
> >>>      
> >>>
> >>------------------------------------------------------------
> ---------
> >>    
> >>
> >>>To unsubscribe, e-mail: 
> tapestry-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail:
> >>>      
> >>>
> >>tapestry-user-help@jakarta.apache.org
> >>    
> >>
> >>>      
> >>>
> >>------------------------------------------------------------
> ---------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>    
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> >
> >
> >  
> >
> 

Mime
View raw message