the multicombo widget with newValues: true option return (with getValue) the raw id of the new item instead of the text representation.
This is an undocumented behavior change. There is a way to restore previous behavior ?
Try with webix 7.2. Enter an additional value “myvalue”. Result “2,myvalue”
Try with webix 7.3 and above: Enter an additional value “myvalue”. Result “2,1729607841498”
This is a blocking problem in our webix update process. I hope you’ll be able to fix it soon.
We checked old bug reports regarding multicombo, it was an intentional change in the multicombo logic and the reason why we made such changes is that there was a risk to duplicate id while adding a new value and risk of errors while pasting several values at once (with separators).
In our changelog 7.3.0 we describe this but breaking changes are indeed not obvious. We are sorry that these changes influenced your webix update process. We will add more detailed information in changelog 7.3.0 about breaking changes.
Thank you for providing your solutions.
And one more workaround will be to use changeId .
Please check the example: Code Snippet
Thanks for your answer and for the changeId-based solution.
I can’t find in the documentation, in multicombo newValues, what is the official way to know which items are added.
In case, as in the official snippet, the multicombo is in a form, getValue() returns either a string representing the list of ids or a javascript array of ids (stringResult=false).
How to know which items are new ? How to get the values of new items ?
The problem is more problematic in case the form sends data directly to a backend, since we can’t request the widget anymore.
Shouldn’t the multicombo be able to return a list of objects ( like : [{id:2, value:"AAA"}, {id:42, value:"BBB"}]) so we can check for new values more easily ?
Unfortinately, there is no official way to know which items are added, but you can mark list item as new by adding it some custom property ( e. g. $custom: true) in "onAfterAdd" event listener.
And if you collect data from the form, you can just replace the array of IDs from the multicombo with full objects from the options.