Trying to add a configuration node within a configuration node

Hey, thanks for all the possible help I might be getting here. I am currently expanding a existing node-red-contrib package and for that I would need the following setup:

  1. Some "normal" nodes (no problem here)
  2. A configuration node that contains a few parameters and another configuration node (a server configuration that I'd like to reuse)

However, when I build the node (I watched out for all the typical pitfalls like the naming of the configuration nodes and referencing them properly, I find that in the "main" (first) configuration node, the second configuration node <select> is just shown as a text input with no way to select the relevant nodes. I also took a look at the node-red-dashboard source code which uses this kind of setup, but there it seems to "just" work. Is there anything I need to watch out for when referencing one configuration node within another configuration node ? Does somebody have a simple working example of this ?

Addition: I also tried using existing code that works when I add it to a "normal node". There the select-element is properly populated with all of the existing configuration nodes, but when I use the same code (more or less, just adpted it so that it works in a config node), it shows the string input again.

Hi @njoye

without seeing your code, it's a little hard to be specific. A common fault is forgetting that the select box id needs to be node-config-input-<propertyName> if its inside a config node.

Also, make use the config node's defaults property that stores the second config node property has a type value set.

Another example from the core is the mqtt-broker config node that has an optional tls node beneath it - node-red/packages/node_modules/@node-red/nodes/core/network/10-mqtt.html at b10ef4c98ce8bf1b61584a046fdb4bc90d485295 · node-red/node-red · GitHub

Thank you so much! The node-config-input-<property> was it! This doesn't seem to be needed for "normal" nodes right? That's why I didn't think I needed to change it and I didn't see that that was the case - with that added it works. Thank you!!

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