An Alternate Pop Up Dialog?

Hi, so far the only pop up i can see is the ok/cancel dialog.
image

However I need something slightly different. Instead of an OK/Cancel pop up, i need one that allows the user to manually type the message on the pop up, and that msg becomes msg.payload.

For example they can type, "Machine Breakdown due to electrical failure".

Or even one that gives a range of selection for the user to choose from

Any idea?

Can I suggest you keep your (related) questions (about the same topic) to just one thread otherwise the channel gets flooded.

3 Likes

Allowing an input for feedback isn't a bad idea.
Will have a look over the vacation.

It's your lucky day - have pushed an update to master branch (not yet on npm) that adds a feedback option to the dialog.
image

4 Likes

Nice update. Did someone mention flows requiring password authorization?

var passwd = msg.payload;
if (passwd=="mypassword"){
    node.send({"payload": "pass"});
} else node.send({"payload": "fail"});

...just a thought...

Or by using a 'switch' node;

passwd

Hi thanks for that update. But when will I be able to access it on node red? :slight_smile:

you can install from master if you wish to try it

cd ~/.node-red
npm i node-red/node-red-dashboard

I think I found a bug. When I try to use the OK/Cancel with input as just and OK with input (no secondary button), the text input is missing.
Screen Shot 2020-02-27 at 4.07.24 PM

Screen Shot 2020-02-27 at 4.09.11 PM

I get around this by putting the flow in a loop that keeps showing the notification until you press OK.

I don't fully understand what you are saying, can you post a very small flow exhibiting the problem?
Also tell us which versions of node-red, dashboard, and nodejs you are using.

The thinking was that if if you had an input then you have to allow the user to cancel their input in case they change their mind.

Looking at the Angular options in fact the .prompt() we use always has the cancel button there - so either you can have the input feedback but have the cancel button - or not have feedback (as we can just use the .alert() function instead.

If we detect no text for cancel we auto switch to the alert style - I guess we could just leave it - but then you would get a blank button if left blank...