Enable always changing "text input" node

Hi

the text input only let preset the text of the input field by sending in a msg.payload.
( doing it once and neglecting any other msg.payload coming in)

I would like always to be able to update the text when msg.payload arrive (in) to node
not only in preset

and also to send any typed text when ENTER pressed (out) from node
( so input does not sent automatcly as output)

any ideas?

thanks

Frankly speaking I have several difficulties to understand exactly what u mean, maybe some native english speaker can support u better.

Regarding the second point, on the text input node have you read on the config of the node at the end "Setting Delay to 0 waits for Enter or Tab key, to send input.".

Regards

Hi
sorry for my English
let me try to explain the usage

I have remote eeprom (in mesh network) and would like writing to it and reading from it using the same "text input" node

so
writing to it using text input and setting time to 0
entering text -->pressing enter-->msg.payload out is holding the text

reading by doing some mesh network command (pressing discovery button in my dashboard)
msg.payload in is holding the eeprom text-->"text input" node-->text shown on screen

the problem that the reading part is done only once at preset
any other reading request (discover) is neglected by the node (text not shown on screen)

how can I change it?
so always msg.payload in to "text input" node is shown on screen

hope it is more understandable

BR

As a matter of fact, the input text node from the dashboard always behaves like you want by default. It will not neglect the second and following msg.payload coming in.

However, the msg.payload type has to match the mode type from the dialog configuration dialog.

If they don't math then msg.payload will be "ignored" as you said. For instance, if you configured the mode type as number and send a msg.payload of string type then this msg.payload will not be displayed in the input box.

Below flows shows how it works when payload type matches (first flow) and when it does not match (second flow).

r-01

Flows:

[{"id":"4f70e4e8.bb466c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"113b6d3a.d15a43","type":"ui_text_input","z":"4f70e4e8.bb466c","name":"","label":"","group":"1f75f155.c8269f","order":0,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":370,"y":360,"wires":[[]]},{"id":"a6a27da.f141f8","type":"inject","z":"4f70e4e8.bb466c","name":"1 - number","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":320,"wires":[["113b6d3a.d15a43"]]},{"id":"8732f101.b6ba7","type":"inject","z":"4f70e4e8.bb466c","name":"","topic":"","payload":"string 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":380,"wires":[["113b6d3a.d15a43"]]},{"id":"3d88abda.0c58a4","type":"inject","z":"4f70e4e8.bb466c","name":"3 - string","topic":"","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":440,"wires":[["113b6d3a.d15a43"]]},{"id":"cd4fa537.dfb8f8","type":"ui_text_input","z":"4f70e4e8.bb466c","name":"","label":"","group":"8c30bb65.bd5958","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"","x":380,"y":120,"wires":[[]]},{"id":"2e27a2e4.77de6e","type":"inject","z":"4f70e4e8.bb466c","name":"string 1","topic":"","payload":"string 1","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":80,"wires":[["cd4fa537.dfb8f8"]]},{"id":"25295d6a.74eae2","type":"inject","z":"4f70e4e8.bb466c","name":"string 2","topic":"","payload":"string 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":140,"wires":[["cd4fa537.dfb8f8"]]},{"id":"5eac910c.abb5a","type":"inject","z":"4f70e4e8.bb466c","name":"string 3","topic":"","payload":"string 3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":200,"wires":[["cd4fa537.dfb8f8"]]},{"id":"28f2766a.24c87a","type":"inject","z":"4f70e4e8.bb466c","name":"2 - number","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":500,"wires":[["113b6d3a.d15a43"]]},{"id":"1f75f155.c8269f","type":"ui_group","z":"","name":"G2","tab":"76bc2153.6c6be","order":2,"disp":true,"width":"6","collapse":false},{"id":"8c30bb65.bd5958","type":"ui_group","z":"","name":"G1","tab":"76bc2153.6c6be","order":1,"disp":true,"width":"6","collapse":false},{"id":"76bc2153.6c6be","type":"ui_tab","z":"","name":"LAB","icon":"dashboard"}]

The text input should always set the displayed text to any value passed to it via msg.payload. That is what is meant by presetting it. Messages can be passed to it at any time.
You probably want to disable message pass through in the node.
To prevent it sending a message until enter is pressed then set the delay to 0 (as described at the bottom of the config screen. See this flow for example of how it should work.

[{"id":"5c2c4e08.df4238","type":"ui_text_input","z":"acd8202b.36972","name":"","label":"","group":"b7868331.17d03","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"","x":229.5,"y":1229,"wires":[["9873918b.33e59"]]},{"id":"e64c1839.afef3","type":"inject","z":"acd8202b.36972","name":"","topic":"","payload":"some input","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":87,"y":1231,"wires":[["5c2c4e08.df4238"]]},{"id":"9873918b.33e59","type":"debug","z":"acd8202b.36972","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":418,"y":1229,"wires":[]},{"id":"3dae93b9.60d4b4","type":"inject","z":"acd8202b.36972","name":"","topic":"","payload":"other input","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":84,"y":1310,"wires":[["5c2c4e08.df4238"]]},{"id":"b7868331.17d03","type":"ui_group","z":"","name":"Insert Data Test","tab":"54d30b5d.781dfc","order":1,"disp":true,"width":"6"},{"id":"54d30b5d.781dfc","type":"ui_tab","z":"","name":"Input Test","icon":"dashboard","order":3}]

OK
following your example I can get the same problem

follow this

GOOD
inject "string 1" --> inject "string 2" --> inject "string 3" - all ok

GOOD
inject "string 1" --> go to dash board --> change text to "string" (backspace twice, do not press enter or tab) --> inject "string 2" --> inject "string 3" - all ok

ERROR
inject "string 1" --> go to dash board --> change text to "string" (backspace twice, do not press enter or tab) --> inject "string 1" --> no change in dash board still "string", should be "string 1"

summery : changing the string in dashboard and re-inject it, does not reset the string to it's original

is it only in my setup or you also got it

thanks

Hi, I was able to reproduce what you described. Looks like the issue happens only when msg.payload arrives while you are editing the input field.

I would say that is desirable behaviour. The user would not expect the text he is entering to suddenly change while he is entering it.

1 Like

Indeed, it makes sense. Fully agree, Colin.

I am dealing with user interface few years and mesh iot network for few month

If you put your self in the user side with time set to 0, change Sent only in enter

Changing names of remote mesh nodes
Does not send enter yet but stoped entering text ( some time getting out for few hours or shift change and new user arraive)
Regret the chage and like to reread the original name
Problem

This is common beave, there is not any problem in re sending the same string and expect it to Display

Just to be more precise, since I overlooked the case #2. The change will NOT occur if you are entering new text AND the arriving msg.payload is equal to the previous one.

If you are editing the text and the msg.payload that arrives is different from the previous one then the new text will be displayed.

Considering the above, if you are editing the text and the same old text just arrives you would not want to lose your ongoing work, right ?

This could happen after you change the data and press enter. Could be solved with some additional logic, e.g. storing the previous value and restoring with a button. The ui input text is quite smart already but if you want some specific behavior then additional logic will be required.

Hi
found a workaround / solution

during the string update (reading from remote eeprom)

changing "string2" to "string" (backspace, do not press enter or tab) ->
request read from remote eeprom -> text input node is disabled ->
somehow string is changed to original "string2" and disabled ->
got eeprom data -> text input node is enabled

so if string is not changed I am getting the origianl "string2" ( which is good)

Andrei and Colin
thanks for you help

1 Like