-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lose picker value #179
Comments
We found that $scope.SelectedOptions array doesn't have a value immediately when using CSV but selectedOptions is used to set $scope.model.value in the formSubmitting handler. If an editor clicks the save/publish button before selectedOptions gets set an empty value is saved. Our fix was to set the $scope.selectedOptions when the variable is first instantiated. This stores the existing values and if an editor quickly clicks the save/publish button, nothing is lost. We build the array of { 'key': '', 'label': '' } objects and set the label to Loading ... . Once the ajax call is completed selectedOptions is updated with the returned values, has the correct label and the selected items are rendered. Our understanding is that this would only affect the CSV data format because the other data formats don't need to make the ajax call - all of the details are stored in the value. |
@Dallas-msc any chance of a pull request, or sharing the code changes? Thanks :) |
Hi @TimGeyssens I created a Pull Request (#182) with the change we made to address this issue. Dallas |
Ace, thanks! |
What's the progress on this issue? Losing values/data is a BIG problem and this isn't just an edge case, especially when using multiple pickers (that all require an AJAX request), large datasources (that take some time to process/load) or even a slow(er) internet connection or computer/tablet/mobile... |
Hi @ronaldbarendse we're just discussing this issue at the moment - hopefully get back to you with a solution soon. |
I wonder if in the "formSubmitting" event of each of the pickers we can check to see if it has loaded it's data - if not, then cancel the submit and trigger a notification ? |
@Hendy Is there any temporary fix for this problem? What if I change save to another format instead of CSV. Does that solve this issue? |
It is possible to lose the picker value by clicking Save/Publish button before the picker property editor has finished loading.
You can reproduce by selecting the document and then clicking the Save/Publish button immediately. If you do this before the ajax request to get the picker list has completed an empty value will be saved for that property.
We discovered this as we have a documentType with four Xml TypeaheadList Picker and there are documents where the list is quite long and take a second or two to load. These TypeAheadList Pickers are using the csv format to store the value.
A similar issue was reported for the Umbraco MNTP (U4-4848) that was fixed. The fix was only for the MNTP. There is also a reported issue for nuPickers (U4-6519).
The text was updated successfully, but these errors were encountered: