Testing TotallyInformation's web-components - button-send
A dynamic button that triggers an event with standardised meta-data on-click. It also allows more complex content than the standard HTML button tag.
If UIBUILDER for Node-RED is in use, clicking will automatically send a message back to the Node-RED server.
The detail data sent on the click event mirrors that for UIBUILDER output. Create an event listener in JavaScript to pick up the data. See the source code of this page for examples.
Use topic
, payload
and data-*
attributes to pass to the custom event.
Note that you can't normally include block tags (e.g. <br>, <p>, etc) in a <button> but you can now!