Hi folks,
Have been implemented quite a number of config nodes in the past withouth problems, but now it fails. Must be something stupid, but I don't see what I am doing wrong. So it would be nice if somebody with a fresh pair of eyes can have a look at it.
- The html file of the config node is quite simple:
<script type="text/html" data-template-name="tensorflowObjDetConfig"> <div class="form-row"> <label for="node-config-input-someProperty"><i class="fa fa-file-image-o"></i> Some proper</label> <input type="text" id="node-config-input-someProperty"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('tensorflowObjDetConfig',{ category: 'config', color: '#ff758d', defaults: { someProperty: {value:""} }, </script>
- And this is the js file of the config node:
module.exports = function(RED) { var settings = RED.settings; function TensorFlowObjDetConfig(config) { } RED.nodes.registerType("tensorflowObjDetConfig",TensorFlowObjDetConfig); }
- This config node is being used in the html file of my custom node:
<script type="text/html" data-template-name="tensorflowObjDet"> <div class="form-row"> <label for="node-input-tensorflowConfig"><i class="fa fa-cog"></i> Model</label> <input type="text" id="node-input-tensorflowConfig"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('tensorflowObjDet', { ... defaults: { tensorflowConfig: {value:"", type: "tensorflowObjDetConfig"} }, ... } }); </script>
At first sight this seemed to be working fine. The input of that config node screen is persisted on the server (after Deploy). Because when I open an extra flow editor client browser session, the same data appears in the config node screen in the second client.
And the tensorflowConfig
contains (on the server side) the id of the selected config node. So far so good.
But when I try to get (on the server side) the config node corresponding to that id:
if (node.tensorflowConfig) {
var tensorflowConfigNode = RED.nodes.getNode(node.tensorflowConfig);
}
Then I get an empty config node instance, i.e. all the properties that I have entered in the config node screen are empty ;-(
You can see this also on the server side in the list of active nodes:
Not sure if this exception in the startup log is related to this:
TypeError: Cannot read properties of undefined (reading 'padEnd')
at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:254:62)
at Object.start [as startFlows] (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:394:33)
Thanks!!!
Bart