Delete the OK/Cancel Notification Pop Up Window

Hi everyone, i hope you can help me !
I am using the OK/Cancel Notification in my Dashboard, because I want to see the Notification in the middle of the screen (for better visualization).
My problem is, that I am using this dashboard only for a view, so i am not able to push the "OK" or "Cancel" button.
Can i make a function to delete this Window if for example the msg is "0"?

Thanks!

Hi

what does the last line of the info panel say ?

"Sending a blank payload will remove any active dialog without sending any data."

Hi,

I tried this, but the PopUp Window in my dashboard stays until i push a button...

which version of dashboard do you have installed ?
Simple flow that works on latest dashboard.

[{"id":"ffc4cc70.8ef54","type":"ui_toast","z":"ea593186.4918d","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":480,"y":720,"wires":[[]]},{"id":"af502370.b6a1d","type":"ui_button","z":"ea593186.4918d","name":"","group":"5749dfff.2a222","order":5,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"Hello World","payloadType":"str","topic":"","x":150,"y":720,"wires":[["ffc4cc70.8ef54","7b276d83.b4bf84"]]},{"id":"7b276d83.b4bf84","type":"delay","z":"ea593186.4918d","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":220,"y":780,"wires":[["cfa0ce35.11646"]]},{"id":"cfa0ce35.11646","type":"change","z":"ea593186.4918d","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":780,"wires":[["ffc4cc70.8ef54"]]},{"id":"5749dfff.2a222","type":"ui_group","z":"","name":"Default","tab":"8d16f8ce.591d18","disp":true,"width":"6","collapse":false},{"id":"8d16f8ce.591d18","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

I have updated the version to 2.19.2.
With an empty payload, the notification window also pops up (just with an empty message).

In your flow, the pop up window doesn't disappear, it opens another pop up window, where I have to press the OK button.

In my case, I want tho show Error Codes from a machine. So if an Error appears on the machine, the pop up window should show the error with the discription (i wrote another msg). If no Error is on the machine, it sends "0". I want if the error is "0" the pop up window closes automatically. But I don't know how to do that...

You need to send a payload with nothing in it. Not a space or blank.

There seems to be a certain amount of ambiguity in the text. The difference between a blank payload and a payload containing blank is fairly subtle.

And how to send an empty payload??

As per my example flow above
Or a simple function

msg.payload =  "";
return msg;

Oh, I thought it meant a payload of null, not an empty string.

1 Like

Thank you !

Sent an empty payload and the Notification Windows disappeared !

Tell me please, I am sending an empty payload, it opens an empty pop-up message

[{"id":"219e5d54.a59c22","type":"ui_toast","z":"95458945.6a73c8","position":"dialog","displayTime":"3","highlight":"","sendall":false,"outputs":1,"ok":"OK","cancel":"","raw":true,"topic":"","name":"","x":720,"y":760,"wires":[[]]},{"id":"f109b22b.af523","type":"inject","z":"95458945.6a73c8","name":"","topic":"","payload":"Hello","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":330,"y":740,"wires":[["b5da7e35.27ac9","219e5d54.a59c22"]]},{"id":"7b15c3ff.fa506c","type":"function","z":"95458945.6a73c8","name":"","func":"msg.payload='';\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":820,"wires":[["219e5d54.a59c22"]]},{"id":"b5da7e35.27ac9","type":"delay","z":"95458945.6a73c8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":860,"wires":[["7b15c3ff.fa506c"]]}]

why?
15 Jan 16:33:32 - [info] Node-RED version: v1.0.1
15 Jan 16:33:32 - [info] Node.js version: v12.11.1

Which version of node-red-dashboard ? This was fixed in 2.19.3.

Hello, I upgraded dashboard to 2.22.1, and sending a empty payload close the first notification but create a new one , empty with the OK button

Any help ? thanks

Hi JFL, welcome to the forum.
Can you create a small flow (just a few nodes) showing the problem you are seeing (it is not clear to me from your question). Then read this post to see how to share it here. Tell us what the flow does and what it should do.

Does this not work ?

[{"id":"6739e8d1.ae8b18","type":"inject","z":"8418773.2570188","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello world","payloadType":"str","x":170,"y":200,"wires":[["7f28afc.0b0c25"]]},{"id":"7f28afc.0b0c25","type":"ui_toast","z":"8418773.2570188","position":"dialog","displayTime":"10","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":390,"y":200,"wires":[[]]},{"id":"4eac0162.49449","type":"inject","z":"8418773.2570188","name":"clear","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":150,"y":260,"wires":[["7f28afc.0b0c25"]]}]