UI Text Input state is not saved (time, date, week color picker)

#1

If the "Mode" property for a Text Input UI Dashboard node is changed to color, time, month, week etc. picker the state (value) is not saved as is with all the other controls included as part of the Dashboard. Note that the state is saved if the Mode property is set to the default value of "Text Input". By "not saved" I mean if you close the UI browser window and then reopen it, the previously selected value is gone.

I'm trying to figure out a good workaround to refresh the value

The obvious solution is to save the state in a flow level variable and then send an input message with the payload set to the stored value. However, I cannot find a way to detect an event for "UI browser opened". One solution is to use an Inject Node that repeats every second. This results in lots of mostly unnecessary messages and therefore is not an efficient solution. Any suggestions would be greatly appreciated. Thanks!

0 Likes

#2

Look at the "ui control" dashboard node, it emits a msg everytime a browser client connects or disconnects.

0 Likes

#3

Why not check this option in the inject node ? The node will send the payload only once.

r-01

0 Likes

#4

It is my understanding that startup means when u redeploy or restart Node-Red proper. The information disappears when the UI browser window is closed. Thus I have no event to trigger an injection node.

0 Likes

#5

That sounds like what I was looking for. Thank you!

0 Likes