This shouldn't be this hard! I want to reset some UX controls tied to a list.
I have a list with 3 UX controls configured for the detail view. I have several buttons across the bottom of the panel. One is for "New Record" and one is for "Cancel Changes". The idea is you click on "New Record" to enter a new record in the detail view which consists of a name, a checkbox and an image field.
Another button is to "Save" the detail view controls back to the list. However, before you save, I want to be able to cancel any changes made to the detail view. So I have some code on the cancel button which clears the detail view controls (basically does a .setValue with value set as ' '). This doesn't clear the "dirty" status as I have an enable expression on the "save" button set to dialog.listDetailView.PHOTO_LIST.isDirty = true. After I press the "Cancel Changes" button, the UX controls clear, but the "Save" button is still disabled, I guess meaning the list is still dirty.
I have tried adding the resetform method to the cancel changes button, however this seems to reset every control on all the panels (I have 4 panels with headers and footers with values set in them so it is quite tedious to set everything up again when I do a reset form, as well as re-selecting the selected rows in multiple lists on the panels).
I have also tried {dialog.object}.isDirty = false for all the detail view controls and also the list. But nothing seems to clear the dirty status of the list. I have also tried the .setClean method, again with no success.
There must (should?) be an easier way to do this. Any help appreciated.
Cheers,
I have a list with 3 UX controls configured for the detail view. I have several buttons across the bottom of the panel. One is for "New Record" and one is for "Cancel Changes". The idea is you click on "New Record" to enter a new record in the detail view which consists of a name, a checkbox and an image field.
Another button is to "Save" the detail view controls back to the list. However, before you save, I want to be able to cancel any changes made to the detail view. So I have some code on the cancel button which clears the detail view controls (basically does a .setValue with value set as ' '). This doesn't clear the "dirty" status as I have an enable expression on the "save" button set to dialog.listDetailView.PHOTO_LIST.isDirty = true. After I press the "Cancel Changes" button, the UX controls clear, but the "Save" button is still disabled, I guess meaning the list is still dirty.
I have tried adding the resetform method to the cancel changes button, however this seems to reset every control on all the panels (I have 4 panels with headers and footers with values set in them so it is quite tedious to set everything up again when I do a reset form, as well as re-selecting the selected rows in multiple lists on the panels).
I have also tried {dialog.object}.isDirty = false for all the detail view controls and also the list. But nothing seems to clear the dirty status of the list. I have also tried the .setClean method, again with no success.
There must (should?) be an easier way to do this. Any help appreciated.
Cheers,
Comment