You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "squallmat ." <sq...@gmail.com> on 2014/09/11 15:47:14 UTC

ajax reload

Hi,

I have a zone where I add/remove dynamically a list of object,
the object is made of a boolean that is associated with a t:checkbox. When
I modify the checkbox (check/uncheck) and then update the zone (because
list of objects change : add/remove) the value of checkboxes come back to
there original values.

So, on ajax reloading a zone, it seems values modified are not saved.

Is this normal behavior ? How can I keep the modifications made in the
checkboxes when reloading the zone ?


Thanks.

Re: ajax reload

Posted by Lance Java <la...@googlemail.com>.
You could use the observe mixin here:
http://tapestry-stitch.uklance.cloudbees.net/observedemo

For example you could observe the 'click' event on a button and send all of
the checkbox values with the event.

Re: ajax reload

Posted by "squallmat ." <sq...@gmail.com>.
humm, I really hate coding in javascript ... Is there a way to "fake" Post
a form to save the values ? :p

2014-09-12 14:42 GMT+02:00 Thiago H de Paula Figueiredo <th...@gmail.com>
:

> On Fri, 12 Sep 2014 04:44:36 -0300, squallmat . <sq...@gmail.com>
> wrote:
>
>  My data are in a form with many others data, If I submit I will Post
>> them. What are the other ways to do that ?
>>
>
> You wouldn't be able to use EventLink or ActionLink. You'd need to write
> custom JavaScript to build an AJAX URL with the values of the checkboxes as
> query parameters. Then, in the event handler method, you'd need to read
> these values and set the corresponding page or component class fields
> yourself.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: ajax reload

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 12 Sep 2014 04:44:36 -0300, squallmat . <sq...@gmail.com>  
wrote:

> My data are in a form with many others data, If I submit I will Post  
> them. What are the other ways to do that ?

You wouldn't be able to use EventLink or ActionLink. You'd need to write  
custom JavaScript to build an AJAX URL with the values of the checkboxes  
as query parameters. Then, in the event handler method, you'd need to read  
these values and set the corresponding page or component class fields  
yourself.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: ajax reload

Posted by "squallmat ." <sq...@gmail.com>.
My data are in a form with many others data, If I submit I will Post them.
What are the other ways to do that ?

2014-09-11 19:41 GMT+02:00 Thiago H de Paula Figueiredo <th...@gmail.com>
:

> On Thu, 11 Sep 2014 13:52:50 -0300, squallmat . <sq...@gmail.com>
> wrote:
>
>  I don't submit the form in Ajax request so...
>>
>> Is there way(s) to save values without submitting form ?
>>
>
> That's not the only way of doing it, but that's the easiest.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: ajax reload

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 11 Sep 2014 13:52:50 -0300, squallmat . <sq...@gmail.com>  
wrote:

> I don't submit the form in Ajax request so...
>
> Is there way(s) to save values without submitting form ?

That's not the only way of doing it, but that's the easiest.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: ajax reload

Posted by "squallmat ." <sq...@gmail.com>.
I don't submit the form in Ajax request so...

Is there way(s) to save values without submitting form ?

2014-09-11 16:06 GMT+02:00 Thiago H de Paula Figueiredo <th...@gmail.com>
:

> On Thu, 11 Sep 2014 10:47:14 -0300, squallmat . <sq...@gmail.com>
> wrote:
>
>  Hi,
>>
>
> Hi!
>
>  So, on ajax reloading a zone, it seems values modified are not saved.
>>
>
> Unless you're submitting the form in the AJAX request, no values are
> modified server-side, so, when you re-render the checkboxes, they lose
> their state.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: ajax reload

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 11 Sep 2014 10:47:14 -0300, squallmat . <sq...@gmail.com>  
wrote:

> Hi,

Hi!

> So, on ajax reloading a zone, it seems values modified are not saved.

Unless you're submitting the form in the AJAX request, no values are  
modified server-side, so, when you re-render the checkboxes, they lose  
their state.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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