Best practice for canceling changes to associated objects on a single page.(Objects on the memory not in db)
0
I'm working on a page that displays a main object along with three different associated objects, two of which are displayed as lists. When a user clicks the cancel button, I want to revert changes made to both the main object and its associated objects. Currently, I've implemented this by: Rolling back the main object Retrieving the associated object lists Looping through each list to roll back individual associated objects While this approach works, it feels cumbersome and I'm concerned about performance with larger datasets. What's the best practice or most efficient way to handle canceling changes to multiple associated objects on a single page? Are there built-in Mendix features or design patterns that could simplify this process and potentially improve performance? I'd appreciate any insights or recommendations for a more elegant solution. Thanks in advance for your help!"
asked
Okan Gunes
2 answers
0
Hi Okan,
I haven't tried it but On cancel , you can retrieve main object from DB and use "clone object" java action from community commons and give source object as DB object and target object as memory object and set with association as true in deep clone . It will copy value from DB object to memory object with association
answered
Sharad Suryavanshi
0
Hi Okan,
have you tried "deep clone" java action , present in same community commons module.