[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: How to reset a form enclosed in a zone from the java-side handler?
From:       Jon Williams <williams.jonathan () gmail ! com>
Date:       2014-04-12 16:33:51
Message-ID: CAKWjvk5AyZBSAb+70WENnepHcJuDecAEO25uqx-8+5RJOekbXA () mail ! gmail ! com
[Download RAW message or body]


Thanks Geoff . Worked like a charm.


On Fri, Apr 11, 2014 at 11:00 PM, Geoff Callender <
geoff.callender.jumpstart@gmail.com> wrote:

> I'd recommend using Form's normal events. See:
>
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/whatiscalledandwhen
>
> or for T5.4:
>
>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/whatiscalledandwhen
>
> Instead of returning the zone from onSelected, return it from onSuccess
> and, if errors are possible, onFailure. Then in onPrepareForRender set the
> form values to whatever defaults you want.
>
> Geoff
>
> On 12/04/2014, at 3:24 AM, Jon Williams wrote:
>
> > I have a form enclosed in a zone. When I submit the form with my register
> > button, it's being handled by method:
> > private Object onSelectedFromRegister() {
> > ...
> >   return zone;
> > }
> >
> > The default behaviour seems to be that when the zone gets re-rendered the
> > UI form fields retain their submitted post values client side.
> > What I'd like to be able to do is, in my register handler (see above),
> i'd
> > like to null out all of the form fields next time the zone re-rerenders.
> >
> > In my form I have a text field component that's bound to a page property
> > that has no persistence. So it's just like a regular instance variable in
> > my page class. How can I (javaside) reset the form (or just the
> textfield)
> > w/o writing javascript? I've tried injecting the form and the textfield
> > components, but found no useful methods there. And nulling out the
> instance
> > variable does nothing in this regard either.
> >
> > any suggestions/ clues much appreciated.
> > thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic