Node number of ports changed and persisted on diagram

If the oneditprepare changes the number of ports on a node it is not persisted across refresh of diagrams. This should be persisted (maybe oneditprepare called on diagram load) or new onLoad function is added.

Are you asking how to do it? Because it is possible to change the number of outputs as seen with the Function and Switch nodes amongst others.

The thing you have probably not done is add outputs as one of the properties in the node's defaults object. Without that, the editor doesn't know it might change and will use the value from the node definition.

Had tried and didn't seem to work at first. After seeing your response realised it was due to it being an existing node which I had enhanced. Annoyingly when the change is made to an existing node, no ports appear. Assume this is a bug. Did this work correctly in the past? That is the logic should be changed so that if the node has a number in outputs it is not overridden by the ports:1 if coded.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.