ahh … so functionally similar to input type bool with submitOnChange:true … except its a Pause/Resume button calling another function first instead of like a toggle just returning control to the same function?
When that button is pressed, this method is called:
def appButtonHandler(btn) {
// from the button above, btn = "thisButton"
}
That method runs, and then the page is refreshed as if there were a submitOnChange: true. The submitOnChange: true is implicit to the input for type button.
An app can have multiple buttons, and they will each call that method. The method has to sort which one was pressed, and what to do about it. See HSM for a more complex example of buttons in the UI.
[app:569] 2018-09-29 17:28:35.107:errorgroovy.lang.MissingMethodException: No signature of method: app15382673065971318675034.unsubscribe() is applicable for argument types: (com.hubitat.hub.domain.Location) values: [home] Possible solutions: subscribe(java.lang.Object, java.lang.String, java.lang.Object) on line 40 (updated)
Yes, a variable can be used. Also, this new input type supports a few additional options:
textColor: "(css name or #hex)"
and
backgroundColor: "(css name or #hex)"
The button input will trigger the appButtonHandler(btn) method and then trigger a submitOnChange to update the UI. Keep in mind, this will submit all fields on the page just like any other field that has a submitOnChange:true