Closed derrell closed 4 years ago
Do you have a suggestion how this could be done? probably an "index" property or something like this, then sorting the objects into an array before it is processed. Have to look at the code, it's been a while.
Why not have formData be an array instead of a map? Then each element of the array could be a map with a name= field plus all of the other existing fields?
It must be backwards- compatible, so it should accept the array format on top of the old map format. Would you have a PR that would do that? I have never experienced a problem with the order of the keys in the map (they were always enumerated in the defined order), so it's not really at the top of my priorities. But you are right that the design is flawed in principle because of the unordered character of maps.
Library is deprecated, any further work will be done in https://github.com/qooxdoo/qxl.dialog
Dialog.Form takes a map for formData. It then iterates over that map to create the form model. The problem is that in JavaScript, a map is unordered. You have no guarantee that the order in which you create the keys is the order that for...in will give them to you. This means that the form could end up with fields in an arbitrary order...