I'd like to be able to manipulate a flow variable in a template in a 
node-red flow.

In particular, the template is an HTML document, and in its body are a 
couple of lines:

    <div><button type="button" onclick='doIt("1");'>LR</button><span id="LR"
> LR data </span> </div>
    <div><button type="button" onclick='doIt("2");'>BR</button><span id="BR"
> BR data </span> </div>

that set up two buttons next to some data for a couple of rooms. The intent 
is that to see more information about one of these rooms, the user presses 
the corresponding button. Which button was pressed is communicated using a 
flow variable.
What I've tried is defining

function doIt(m) { flow.set('showMe',m); }

This fails -- and depending on how and where I try it, it can prevent the 
entire web page from loading. However,
(1) A similar line of code in a node-red function works just fine.
(2) The invocation of the doIt() function on pressing the button works. I 
can substitute alert("blah blah") for the call to flow.set() to see this. 

So, what am I supposed to do to set a flow variable inside the HTML 
document of a template?

Many thanks!

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/d79e99ec-2eca-49fa-8591-3b037b6647a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to