I want to prevent navigation in a parent list control, it the child list's detail view is dirty.
There are plenty of variables in setting this up, so I have attached a test UX.
The lists are based on the video AA List Control - Cascading Lists. But I have added a Detail View to the child list.
To use the test UX, the lists must be bound to the Northwind customer database. I am using MySQL.
Here are some specifics:
This is for a desktop web application.
The child list has the Detail View sync policy set to "Perform client-to-server sync whenever user saves edits to a row in a list".
I do not want to check the option in the child list Detail View tab to "Auto-commit detail view on row select".
When the child list Detail View is dirty, and navigation is attempted in the parent list, it will fire the message from the child list "Warning - dirty Detail View record". This is good.
But it will...
a) Allow the navigation in the parent list to take place.
b) Remove any edits that were made to the Detail View controls.
In the parent list I then added code to test if the child list's Detail View is dirty. It true, it prevents navigation.
This prevents the navigation, but it still remove any edits that were made to the Detail View controls. There is an Detail View event, modeChanged, that may be causing this. I added an alert to this event to test. It fires a lot, apparently even when the mode has not changed. The alert is commented out, so it must be enabled in the process of testing.
I am using Build 4912-5055.
What am I missing here?
testCascadingLists.a5wcmp
There are plenty of variables in setting this up, so I have attached a test UX.
The lists are based on the video AA List Control - Cascading Lists. But I have added a Detail View to the child list.
To use the test UX, the lists must be bound to the Northwind customer database. I am using MySQL.
Here are some specifics:
This is for a desktop web application.
The child list has the Detail View sync policy set to "Perform client-to-server sync whenever user saves edits to a row in a list".
I do not want to check the option in the child list Detail View tab to "Auto-commit detail view on row select".
When the child list Detail View is dirty, and navigation is attempted in the parent list, it will fire the message from the child list "Warning - dirty Detail View record". This is good.
But it will...
a) Allow the navigation in the parent list to take place.
b) Remove any edits that were made to the Detail View controls.
In the parent list I then added code to test if the child list's Detail View is dirty. It true, it prevents navigation.
Code:
var listObj = {dialog.object}.getControl('list_Cities'); if(listObj) { if(listObj.detailViewIsDirty() == true) { return false; } }
I am using Build 4912-5055.
What am I missing here?
testCascadingLists.a5wcmp
Comment