cancel
Showing results for 
Search instead for 
Did you mean: 

Detection of changes in the context prior saving a document

alejandro_bindi
Active Contributor
0 Kudos

Original thread title: IS_CHANGED_BY_CLIENT and RESET_CHANGED_BY_CLIENT methods / selection change

Does anyone know, why is that the RESET method is recursive, but the IS method isn't?

The problem is, I need to trigger a save of a document only when there is some change made by the user, but to do that i'm being forced to implement myself a recursive method which uses both IS_CHANGED_BY_CLIENT and GET_CHILD_NODES methods. While I simply call the RESET_CHANGED_BY_CLIENT method of the root node and it affects all subnodes.

Another problem is that, the selection changes (e.g. in a dropdownbyindex) don't get accounted as changes by the IS_CHANGED_BY_CLIENT method.

Is there any simpler way to implement this?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Alejandro,

i faced same issue and did the same things what you are doing and as per my analysis this is the only way to do this as is_changed_by_client is not recursive.

or other way is you can maintain old data with you and compare old with new data to trigger save.

i tried these two ways only, if you find something new let me know.

Regards

Manish

alejandro_bindi
Active Contributor
0 Kudos

Thanks for your comments Manish. I've already programmed the recursive method and it is working ok, seems to be the only way then.

But how did you solve detection of selection changes? Currently i'm thinking of having an event handler for each dropdown, which will mark a flag to be evaluated additionally to the method's result. You did the same, or selection changes didn't matter in your case?

Thank you

Solved: The context change log seems to be a far better alternative, it also detects selection changes.

Check DEMO_CONTEXT_CHANGES example. If you need only to detect changes, you can use just the enable_context_change_log and get_context_change_log methods.

It may be a little bit taxing when the context is large though, I'd like if anyone which has had this experience could comment.

Former Member
0 Kudos

Hi Alenjandro,

i didnt fact that issue in my case. i will let you know if i find something.

Regards

Manish

alejandro_bindi
Active Contributor
0 Kudos

I've edited my post above with the solution.

Regards