Get feedback from template

Hey there,
I'm trying to get a feedback from my ui template. I want, that if a link is pressed, i get a feedback from the template node. (same like the feedback from a dashboard button)
Can you explain me how to do so?

Does the built in help not work?

of course I tried this source code..

I reinstalled the dashboard now but it was still not working so I reinstalled node-red and after that it works now..

Sorry to point out the obvious but there are so many who don't read the built in help. I'm certain you have seen posts where they ask "how do I ..." and its right there in the node help.

And to be fair, you didn't state you had tried that :wink:

Glad its sorted.

Hello all,

I have a new problem which fits in a way in this topic.

I want to have an text input of the dashboard (like I get with the text input node).
I would like do that with the ui template, because I want to do a table where I can write in one field. The input should then be the feedback of the template node.

I tried to do that as followed but it does not get the input of the text back..

what am I overlooking?

content will be the DOM object not the text.
Try return content.value inside the function

also, to debug this, you can add debugger; inside the function and open the browsers devtools (F12) - the code will stop on the debugger line when executed so you can inspect the values and see what is happening.

thank you! now it works.
I always tried to change the var content = document.getElementById("test"); to var content = document.getElementById("test").value;

that might not work as content will only ever have the initial value (i.e. it will get populated once when the <script> initialises & wont get updated when you type)

also, to debug this, you can add debugger; inside the function and open the browsers devtools (F12) - the code will stop on the debugger line when executed so you can inspect the values and see what is happening.

what do you mean by that?

exactly what it says.

If you put the keyword debugger; in the function the browsers developer tools (opened by F12 key) will stop on that line (when the code executes) and permit you to debug and inspect and see what is REALLY going on (as opposed to guessing / modifying / re-trying etc etc)

okay, thank you!

an other question:
as i mentioned I am trying to do a table.
I try now to bind the javascript array "header" into the table but i can not just by define him.

Don't think you can access flow at client side (in the browser) - I believe it has to be passed in.

If you put debugger statement before those and look in Devtools you would see they are empty.

This is a subject for a new thread.

I suggest you title it something like "how can i pass array from flow to UI template"

But before that, there are several flows on the flow library that do this AND there is similar info in the built-in help of the UI template.