Does Node-Red have the ability to make a requester?

Although there is the text input node.

I'm just wondering if there is a way to make a requester pop up?

I know that would be after a button is pressed so really I could change things around and put a text input node there....

But screen real estate/layout.

A requester would be nice.

Just asking.

When you say requester, do you mean a (fancy) popup overlaying the page where you can fill in a form, such as a modal? Or something else entirely

The former.

A "fancy" popup overlaying the page.

Try the suggestions in this topic :slight_smile:

1 Like

Following the link, reply #8......

Ok. I am going to have to work out how to use that.

Does it import to NR?

(Runs off trying that)

It’s using the Dashboard template node.

(I'm going to cop it for asking, but....)

Ok, put it in the dashboard template node.

Stuck an inject node into it.

Injected and.....

(am I supposed to send anything to set up the request?)

I'm guessing I may. But this is really getting at/beyond my knowledge.
(I'm trying)

So looking at the code:

<script>
    // Get the modal
var modal = document.getElementById('myModal');

// Get the button that opens the modal
var btn = document.getElementById("myBtn");

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];

Those variables need to be set to something as they are used to make the requester?

But (showing ignorance) what is document.get....?

Ooh boy, I forgot about that for a moment. I’m going to link you some manuals. These were mentioned last month in other topics, but as far as I know there are no existing ui nodes to do this. Meaning if you want the functionality you will have to program it yourself. Which means HTML and JavaScript.

This however is not beginner level. I’d say it’s intermediate but to understand what you’re doing you will need a bit of experience with basics. So I’m going to link a few different things, and it’s up to you if you’re willing to go that way.

Here’s a CodeAcademy starter course for JavaScript. I’d say that, as long as you’re not planning to write custom nodes, blocks 1-8 and 12-14 should give you most regular things to use in function and template nodes. You won’t have to worry about the transpiling down from block 10, the things covered in this course are all supported in Node-RED without additional steps.

For the code from reply 8, understanding of the HTML block model/DOM is needed. Remember the stacking wooden figurines comparison I made in the other thread? Exactly like that. The document.getElementById call searches for an element from the html added to the template with the id attribute set to that value.
W3Schools has a decent tutorial to get started with HTML. To understand what is going on here/things that might be useful for understanding other Node-RED topics too.

https://www.w3schools.com/html/default.asp

If you follow that until they start talking about <canvas> it will cover most you’ll might encounter.

Next, to combine your new JavaScript with HTML knowledge, take a look at Mozilla’s introduction to DOM programming:

Good luck!

You don't need to inject template nodes. Just add a template node, copy & paste the code from the modal example, ok, deploy, refresh dashboard and you will get a button. Click it and you should get a modal window.

Bakman2,

Yeah, I sort of get that, but I guess I just wanted to be sure the node was "invoked".

So...... That aside (my stuff). You say, stick the node in a flow and deploy.
I will get a button.... Where?
Click on it (the button I'm guessing) and I should get a modal window.

As there is no sign of said button, I am kinda lost.
(But that is status-quo for me.)

(Edit)

Ok, silly me.
Look in the node's option.
Found it.
Shall continue exploring.

Alfelix,

Thanks. Shall look at soon.