You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by SG Tapestry <sg...@gmail.com> on 2005/05/03 22:49:29 UTC

Reset behavior in a form

Hi,

I have a need where I need to cancel out of a small editing
section/component inside a form that contains other tapestry
components. I want the cancel to forget all the changes that I made in
that component and revert back to their previous values. Currently, I
have an ImageSubmit mapped to an onCancel listener which puts the
component out of edit mode. But, since the form components (TextField,
PropertySelection, Checkbox, etc.) are all mapped to back-end objects,
the changed data is submitted back and available in the objects
regardless of the cancel action. I understand why this is happening -
because of the rewind process which transfers the form values into the
back-end bound objects.

Question:
Is there a way for me to stop this binding from happening during the
rewind process?

Essentially, I want the cancel button to behave like the form's reset
button, but I don't want to reset the entire form, since there are
other components in the form that I don't want to reset. Is it
possible to prevent the rewind process from happening for an
individual component, or get access to the previous values so that I
can set them back in the onCancel handler?

Thanks,
-SG

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Reset behavior in a form

Posted by SG <sg...@gmail.com>.
That seems to be working. Thanks for the response.
-SG

On 5/3/05, SG <sg...@gmail.com> wrote:
> Wouldn't that, potentially, result in a StaleLink exception? I can
> give a try, I guess.
> 
> -SG
> 
> On 5/3/05, Patrick Casey <pa...@adelphia.net> wrote:
> >
> >        Could you make the reset button a directLink instead of a submit
> > button? Unless my mental model of rewind is seriously narfed, that should
> > sidestep the whole rewind process.
> >
> >        --- Pat
> >
> > -----Original Message-----
> > From: SG Tapestry [mailto:sgtapestry@gmail.com]
> > Sent: Tuesday, May 03, 2005 1:49 PM
> > To: Tapestry User
> > Subject: Reset behavior in a form
> >
> > Hi,
> >
> > I have a need where I need to cancel out of a small editing
> > section/component inside a form that contains other tapestry
> > components. I want the cancel to forget all the changes that I made in
> > that component and revert back to their previous values. Currently, I
> > have an ImageSubmit mapped to an onCancel listener which puts the
> > component out of edit mode. But, since the form components (TextField,
> > PropertySelection, Checkbox, etc.) are all mapped to back-end objects,
> > the changed data is submitted back and available in the objects
> > regardless of the cancel action. I understand why this is happening -
> > because of the rewind process which transfers the form values into the
> > back-end bound objects.
> >
> > Question:
> > Is there a way for me to stop this binding from happening during the
> > rewind process?
> >
> > Essentially, I want the cancel button to behave like the form's reset
> > button, but I don't want to reset the entire form, since there are
> > other components in the form that I don't want to reset. Is it
> > possible to prevent the rewind process from happening for an
> > individual component, or get access to the previous values so that I
> > can set them back in the onCancel handler?
> >
> > Thanks,
> > -SG
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> 


-- 
-SG

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Reset behavior in a form

Posted by SG <sg...@gmail.com>.
Wouldn't that, potentially, result in a StaleLink exception? I can
give a try, I guess.

-SG

On 5/3/05, Patrick Casey <pa...@adelphia.net> wrote:
> 
>        Could you make the reset button a directLink instead of a submit
> button? Unless my mental model of rewind is seriously narfed, that should
> sidestep the whole rewind process.
> 
>        --- Pat
> 
> -----Original Message-----
> From: SG Tapestry [mailto:sgtapestry@gmail.com]
> Sent: Tuesday, May 03, 2005 1:49 PM
> To: Tapestry User
> Subject: Reset behavior in a form
> 
> Hi,
> 
> I have a need where I need to cancel out of a small editing
> section/component inside a form that contains other tapestry
> components. I want the cancel to forget all the changes that I made in
> that component and revert back to their previous values. Currently, I
> have an ImageSubmit mapped to an onCancel listener which puts the
> component out of edit mode. But, since the form components (TextField,
> PropertySelection, Checkbox, etc.) are all mapped to back-end objects,
> the changed data is submitted back and available in the objects
> regardless of the cancel action. I understand why this is happening -
> because of the rewind process which transfers the form values into the
> back-end bound objects.
> 
> Question:
> Is there a way for me to stop this binding from happening during the
> rewind process?
> 
> Essentially, I want the cancel button to behave like the form's reset
> button, but I don't want to reset the entire form, since there are
> other components in the form that I don't want to reset. Is it
> possible to prevent the rewind process from happening for an
> individual component, or get access to the previous values so that I
> can set them back in the onCancel handler?
> 
> Thanks,
> -SG
> 
> ---------------------------------------------------------------------
> 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


RE: Reset behavior in a form

Posted by Patrick Casey <pa...@adelphia.net>.
	Could you make the reset button a directLink instead of a submit
button? Unless my mental model of rewind is seriously narfed, that should
sidestep the whole rewind process.

	--- Pat

-----Original Message-----
From: SG Tapestry [mailto:sgtapestry@gmail.com] 
Sent: Tuesday, May 03, 2005 1:49 PM
To: Tapestry User
Subject: Reset behavior in a form

Hi,

I have a need where I need to cancel out of a small editing
section/component inside a form that contains other tapestry
components. I want the cancel to forget all the changes that I made in
that component and revert back to their previous values. Currently, I
have an ImageSubmit mapped to an onCancel listener which puts the
component out of edit mode. But, since the form components (TextField,
PropertySelection, Checkbox, etc.) are all mapped to back-end objects,
the changed data is submitted back and available in the objects
regardless of the cancel action. I understand why this is happening -
because of the rewind process which transfers the form values into the
back-end bound objects.

Question:
Is there a way for me to stop this binding from happening during the
rewind process?

Essentially, I want the cancel button to behave like the form's reset
button, but I don't want to reset the entire form, since there are
other components in the form that I don't want to reset. Is it
possible to prevent the rewind process from happening for an
individual component, or get access to the previous values so that I
can set them back in the onCancel handler?

Thanks,
-SG

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