Ticket #229 (closed defect: fixed)
collection-control "index already in use" problem
|Reported by:||sdm||Owned by:||mpo|
When myForm.setWireValue(...) is called several times on a form which contains a collection-control, the function crashes with the following error:
uncaught exception: [ControlElements#addElementIndex?] index already in use: /tblMyCollectionTable/rid-2256/id#input
An example of when this problem occurs:
A collection-control in a form shows some data, and below the form there's a button which sends an AJAX call to get the data sorted. The result of the AJAX call is the sorted data, which is then bound to the collection-control using myForm.setWireValue(data);
When this sort button is clicked a few times, the problem will suddenly occur and the collection-control will stop adding childrows.
The problem is resolved when clearElementIndex() is called on the form before setWireValue:
This problem appears in IE, Firefox and Chrome (I haven't tested in any other browsers).