I am using the editableList UI widget, that is also responsible for spawning output pins.
This all works well, I can add/remove/re-order so on and so forth.
I have a function for outputLabels that returns the name of the 'rule', etc etc
However, when I re-order, the logic works, BUT - the original connected wires are still in their position, and not moved around - much like the switch node does.
So I end up with the messages hitting the incorrect connected nodes.
What is the magic ingredient, for retaining the connections to the pins - only having them shifted - likes the pins are?
I haven't looked at the source but I imagine it also reorders the wires array. You can see this if you export any node there is a wires property in the object.
I have studied the switch node - it seems to be doing something _i and i
I don't have a UI element (hidden or otherwise), that controls outputs,
but I am setting my outputs property on oneditsave.
via processing the editableList array which is working as expected.
My attempts at trying to create an object for outputs, simply results in the node just disappearing when being saved. or dragged into the flow.
On further investigation, I need to set _outputs as the new 'change map', assumably this is like a temporary map, for the flow to re-configure its connections.
However, this also does not re-order the wires.
I am setting random numbers for the ID {"45454354":0,"454354343":1},
this make no difference, and I not able to get the node to work like the switch node.
How is the ID associated to the output? is it based on key order?
It seems the connection ordering is dependent on an input control with id node-input-outputs
setting it directly i.e node.outputs | node._outputs has no affect.
Looking at editor.js it will re-order the connections using only the input control.