Delete the OK/Cancel Notification Pop Up Window

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"]]}]

@dceejay hi, on using your flow i am getting popup in localhost:1880/ui
but i want popup to come in localhost/mui(Mdashboard)
i replaced ui_toast with mui_toast,but no popup is coming

Basically my requirement is to give popup on invalid date selection from date_picker.

Nodered version -1.0.5

So i also wanted do delete the notification, but when i send a clear msg, the notif. node sends a payload with the cancel properties. Thats not what i suspected, because help says it would send nothing?? Any Help?

dashboard V2.30.0
NR V2.0.5

Same problem: when i will send a new notif. the first one will send a cancel property. That's not a good behaviour!

[{"id":"d538add5d4364025","type":"ui_toast","z":"ef61e13a9f9a7a76","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"Cancel","raw":false,"topic":"Test","name":"","x":1010,"y":220,"wires":[["870cfec597764f65"]]},{"id":"870cfec597764f65","type":"debug","z":"ef61e13a9f9a7a76","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1190,"y":220,"wires":[]},{"id":"92581aa080f0e07a","type":"inject","z":"ef61e13a9f9a7a76","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Nachricht 1","payloadType":"str","x":730,"y":220,"wires":[["d538add5d4364025","17b1facb1b7d46b4"]]},{"id":"79d999c7d1149819","type":"inject","z":"ef61e13a9f9a7a76","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":790,"y":300,"wires":[["d538add5d4364025","24b64b3a4fc95015"]]},{"id":"17b1facb1b7d46b4","type":"debug","z":"ef61e13a9f9a7a76","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":180,"wires":[]},{"id":"24b64b3a4fc95015","type":"debug","z":"ef61e13a9f9a7a76","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":300,"wires":[]},{"id":"a9e5f618fb321444","type":"ui_toast","z":"ef61e13a9f9a7a76","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"Cancel","raw":false,"topic":"Test","name":"","x":1010,"y":460,"wires":[["4ebad3d49f119cb9"]]},{"id":"4ebad3d49f119cb9","type":"debug","z":"ef61e13a9f9a7a76","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1190,"y":460,"wires":[]},{"id":"df4722c6e0bc0f58","type":"inject","z":"ef61e13a9f9a7a76","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Nachricht 2","payloadType":"str","x":730,"y":460,"wires":[["a9e5f618fb321444","82eb2247c6a99580"]]},{"id":"1c5e9b5779e40714","type":"inject","z":"ef61e13a9f9a7a76","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":790,"y":540,"wires":[["a9e5f618fb321444","10e636d8167050fa"]]},{"id":"82eb2247c6a99580","type":"debug","z":"ef61e13a9f9a7a76","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":420,"wires":[]},{"id":"10e636d8167050fa","type":"debug","z":"ef61e13a9f9a7a76","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":540,"wires":[]}]

@dceejay Do you know something about that? Could you help me?

Why is this not a good behaviour ? You can only have one notification open. If you send a second you are cancelling the first.
Likewise if you automatically remove it (first use case) then the flow needs to know you have removed it so needs some feedback. I will correct the help info.

Mui is not maintained by me. You would need to contact the author of that alternative dashboard

The behaviour is not good in my case because i will ask the user multiple informations.
I also have multiple Tabs open. So i will first push a notification to all browser sessons. The fastest person will read the notification and will answer. Now i will send 2-5 more notifications, because i need more infos. But i also want to delete the notification on all other browser sessions. But now when i delete the others i will get from every session a cancel msg. And in my case cancel is not cancel it is f.e. No or edit. So now i get a "edit" from every session and i can not really identify where its a person clicking edit or just a removed one. It would be better if it would trigger a msg like: Notification deleted or something like that, so you can differentiate. Ore really no msg because nothing happend, it wos no user input. Yout get what i mean?

If you look at msg.socketid you can see which session the response came from - if you include msg.socketid on any "reply"/further notifications then then that notification will only go to that user.