You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ankit Jain <an...@aspiresys.com> on 2019/03/18 09:42:45 UTC

5.3.8 - Track form changes to mark dirty flag

Hello, everyone!

I am using Tapestry v5.3.8.
I am writing a functionality to track changes done within the form and mark a dirty flag when we go to the next page.
I did that using jQuery by serializing the form state. That is working fine but if my form submission (server side) changes  the value, I do not have a way to detect that on client Side.
Though we can have a loop to compare all values on server side, it can be really slow to compare if form involves thousands of input fields.
In Struts, we use to have a way to save the state at the page load so that it can be compared when final submission occurs at the server side.
Can we do something like that in Tapestry?

Regards,
Ankit
[Aspire Systems]

This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

Re: 5.3.8 - Track form changes to mark dirty flag

Posted by Numa Schmeder <nu...@dfacto.ch>.
Hello,

Yes!
You should create a model to encapsulate all your form data and persist this model into the session using annotation on the field. 
You could have 2 versions of this model, one you store on pageLoad and another one you update all the way during your process. At the end of the process you compare both. 

Regards,
Numa


  <http://www.dfacto.ch/>	Numa Schmeder    www.dfacto.ch  <http://www.dfacto.ch/>
NUMA@DFACTO.CH <ma...@dfacto.ch>   |   M +41 79 538 30 01 

DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT


 

> Le 18 mars 2019 à 10:42, Ankit Jain <an...@aspiresys.com> a écrit :
> 
> Hello, everyone!
> 
> I am using Tapestry v5.3.8.
> I am writing a functionality to track changes done within the form and mark a dirty flag when we go to the next page.
> I did that using jQuery by serializing the form state. That is working fine but if my form submission (server side) changes  the value, I do not have a way to detect that on client Side.
> Though we can have a loop to compare all values on server side, it can be really slow to compare if form involves thousands of input fields.
> In Struts, we use to have a way to save the state at the page load so that it can be compared when final submission occurs at the server side.
> Can we do something like that in Tapestry?
> 
> Regards,
> Ankit
> [Aspire Systems]
> 
> This e-mail message and any attachments are for the sole use of the intended recipient(s) and may contain proprietary, confidential, trade secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org