You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Yohan Yudanara <yo...@gmail.com> on 2010/09/22 06:30:27 UTC

[T5.1] Preserve user input while refreshing form inside zone

Hi..

I'm enclosing a whole form inside zone.
And I have an AJAX actionlink to refresh the zone.

Is it possible to preserve user input while refreshing the zone?
I have problem because, when refreshing, textfield value always
discard user input and revert back to the original value.

Thanks in advance.

Best regards,
Yohan Yudanara

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


Re: [T5.1] Preserve user input while refreshing form inside zone

Posted by Yohan Yudanara <yo...@gmail.com>.
Hi LLTYK :),

Thanks for the idea.
Yes, this could be the solution to preserve user input while
refreshing (not submitting) the form.
The drawback is: this will generate many traffic to the server.

Thank you for your help.

On Wed, Sep 22, 2010 at 6:07 PM, LLTYK <LL...@mailinator.com> wrote:
>
> The usual way to save input is to do a form submit. Link the form to the
> zone, and then submitting will trigger the update on the zone after sending
> the data to the server.
>
> However, this does not work if the form is not filled out and valid. In that
> case there's a longer way:
>
> I used the ZoneUpdater mixin on all the form components, not to update the
> zone but to simply record changes serverside (returning void from the event
> handler). Something like this:
> <t:textfield t:id="TextField" value="value"
> validate="required,minlength=3,maxLength=25"
>                  t:mixins="zoneUpdater" t:zone="thezone"
> t:clientEvent="keyup" event="change" />
>  @Log
>  public void onChangeFromTextField(String value)
>  {
>    this.value = value;
>  }

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


Re: [T5.1] Preserve user input while refreshing form inside zone

Posted by LLTYK <LL...@mailinator.com>.
The usual way to save input is to do a form submit. Link the form to the
zone, and then submitting will trigger the update on the zone after sending
the data to the server.

However, this does not work if the form is not filled out and valid. In that
case there's a longer way:

I used the ZoneUpdater mixin on all the form components, not to update the
zone but to simply record changes serverside (returning void from the event
handler). Something like this:
<t:textfield t:id="TextField" value="value"
validate="required,minlength=3,maxLength=25"
                  t:mixins="zoneUpdater" t:zone="thezone"
t:clientEvent="keyup" event="change" />
  @Log
  public void onChangeFromTextField(String value)
  {
    this.value = value;
  }
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/T5-1-Preserve-user-input-while-refreshing-form-inside-zone-tp5557633p5558573.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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