Issue with ui_text_input

Hello there,

I'm facing an issue with ui_test_input nodes. My goal is to set a default value for the dashboard user in these nodes.
I configured the text_input node as "datetime picker" so I inject a datetime value in msg.payload to set a default value to these nodes. What I observe using this procedure is:

  1. The first time the node is initialized or everytime I enter to ui dashboard from a new tab in the explorer) I am not able to load the value to it:
    image
  2. Once I manually interact with the node (setting some values with the picker) I am able to set values through msg.payload
    image

Does anyone know whether I am doing something wrong, or sould I report it as a bug?

Thanks

First off there is no node (I can find) called ui_test_input so please provide the node’s full name like node-red-contrib-????

You also reference text_input. Have you two nodes or a typo?

A sample flow would also be useful along with the version of node-red, node.js and the dashboard. All of that information can be found in the node-red startup log.

Hello,

Info:
The node is node-red-dashboard:3.1.7
node-red: v2.1.3
node.js v14.18.1

From node-red-dashboard the issue is in ui_text_input node (my misspelling **ui_test_input).

I managed to find the solution:
The documentation specifies: Setting msg.enabled to false will disable the input. So I assumed that by default this setting was true. After some tests, I found out that the node only updated its value with the one coming from msg.payload, if msg.enabled was also set to true or as I explained before if there was "manual" interaction with in the dashboard. So I just add msg.enabled = true to my msg and it works as I expected to.

However, is this procedure correct, or there may be some kind of bug? Maybe the browser? (Using Brave V1.39.111 with Chromium 102.0.5005.61)

I let the flow for anyone interested in testing it:

[
    {
        "id": "643cb57935159604",
        "type": "function",
        "z": "bc9b40b34320a510",
        "name": "Init Time",
        "func": "let date = new Date();\ndate.setHours(date.getHours() - 8);\n\nlet ms = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), 0, 0);\n\nmsg = {};\nmsg.payload = ms;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 223,
        "y": 216,
        "wires": [
            [
                "08b2707952a338a2"
            ]
        ],
        "icon": "font-awesome/fa-chevron-right",
        "l": false
    },
    {
        "id": "0e9f7f3d5aa26f70",
        "type": "inject",
        "z": "bc9b40b34320a510",
        "name": "Refresh",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "1",
        "topic": "",
        "payloadType": "date",
        "x": 167,
        "y": 216,
        "wires": [
            [
                "643cb57935159604"
            ]
        ],
        "icon": "font-awesome/fa-repeat",
        "l": false
    },
    {
        "id": "08b2707952a338a2",
        "type": "ui_text_input",
        "z": "bc9b40b34320a510",
        "name": "OEE VInit",
        "label": "From1",
        "tooltip": "",
        "group": "98898f35195ff9f0",
        "order": 3,
        "width": 4,
        "height": 1,
        "passthru": true,
        "mode": "datetime-local",
        "delay": 300,
        "topic": "topic",
        "sendOnBlur": true,
        "className": "",
        "topicType": "msg",
        "x": 316,
        "y": 216,
        "wires": [
            []
        ]
    },
    {
        "id": "5ee530df215731d3",
        "type": "comment",
        "z": "bc9b40b34320a510",
        "name": "With error",
        "info": "",
        "x": 196,
        "y": 176,
        "wires": []
    },
    {
        "id": "e708fa37676c0cb7",
        "type": "comment",
        "z": "bc9b40b34320a510",
        "name": "Corrected",
        "info": "",
        "x": 196,
        "y": 296,
        "wires": []
    },
    {
        "id": "7b537d3b2c689384",
        "type": "function",
        "z": "bc9b40b34320a510",
        "name": "Init Time",
        "func": "let date = new Date();\ndate.setHours(date.getHours() - 8);\n\nlet ms = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), 0, 0);\n\nmsg = {};\nmsg.payload = ms;\nmsg.enabled = true;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 223,
        "y": 336,
        "wires": [
            [
                "cc38f9f9454ea41e"
            ]
        ],
        "icon": "font-awesome/fa-chevron-right",
        "l": false
    },
    {
        "id": "05cda47ef08dd342",
        "type": "inject",
        "z": "bc9b40b34320a510",
        "name": "Refresh",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "1",
        "topic": "",
        "payloadType": "date",
        "x": 167,
        "y": 336,
        "wires": [
            [
                "7b537d3b2c689384"
            ]
        ],
        "icon": "font-awesome/fa-repeat",
        "l": false
    },
    {
        "id": "cc38f9f9454ea41e",
        "type": "ui_text_input",
        "z": "bc9b40b34320a510",
        "name": "OEE VInit",
        "label": "From2",
        "tooltip": "",
        "group": "98898f35195ff9f0",
        "order": 3,
        "width": 4,
        "height": 1,
        "passthru": true,
        "mode": "datetime-local",
        "delay": 300,
        "topic": "topic",
        "sendOnBlur": true,
        "className": "",
        "topicType": "msg",
        "x": 316,
        "y": 336,
        "wires": [
            []
        ]
    },
    {
        "id": "98898f35195ff9f0",
        "type": "ui_group",
        "name": "Test",
        "tab": "facc7602aab8ef87",
        "order": 1,
        "disp": true,
        "width": "24",
        "collapse": false,
        "className": ""
    },
    {
        "id": "facc7602aab8ef87",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Thanks!

1 Like

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