5.3.8 - Track form changes to mark dirty flag

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

5.3.8 - Track form changes to mark dirty flag

Ankit Jain
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: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: 5.3.8 - Track form changes to mark dirty flag

Numa Schmeder-5
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/>
[hidden email] <mailto:[hidden email]>   |   M +41 79 538 30 01

DIGITAL STRATEGY   |   DESIGN   |   DEVELOPMENT


 

> Le 18 mars 2019 à 10:42, Ankit Jain <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]