Here I am answering my own question! Sorry. The answer is to use a web socket. I had tried that, unsuccessfully, before posting my question. The reason it failed seems to be that there were hidden items that I created when experimenting and that had not been removed when cleaning up. Now that they're gone [go to config tab and remove things that shouldn't be there] and a few other loose connections have been cleaned up, I'm getting the value I need where I need it!
My enlightenment came from the thread "2 instances of websocket" from 10/11/14: https://groups.google.com/forum/#!topic/node-red/Aek6xPFpFqI Maybe this'll help someone else, so I'm leaving it. On Friday, May 26, 2017 at 3:37:16 PM UTC-4, Richard wrote: > > 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/668b763b-c45c-4b59-a3a3-30dc3b98d2b4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
