I'm a little stymied how I'm supposed to use submitOnChange in dynamicPages. I found a thread from a couple years ago talking about how doing complex processing could cause a page to fail, but it seems like any submitOnChange input leads to a blank page for me.
Here's a test app:
definition (
name: "submitOnChange Demo", namespace: "evequefou", author: "Mike Bishop", description: "Why does this break?",
importUrl: "TBD",
category: "My Apps",
iconUrl: "",
iconX2Url: ""
)
preferences {
page(name: "mainPage")
}
Map mainPage() {
dynamicPage(name: "Main Page", title: "Holiday Lighting", install: true, uninstall: true) {
section("Options") {
input "thisName", "text", title: "Name this App", submitOnChange: true
if(thisName) app.updateLabel("${thisName}")
input "device", "capability.colorControl", title: "RGB light", multiple: false, submitOnChange: true
}
}
}
Typing text in the text input and then moving focus anywhere turns the page blank. Choosing a device in the device input and then clicking anywhere turns the page blank. If I exit and re-enter the app, it appears that the values from the inputs are saved -- though the name update doesn't run until the app loads that second time -- but surely that's not the intended mechanic.
Is submitOnChange deprecated? Is there a different mechanism I should use to add more inputs based on what's already entered? More generally, is there documentation somewhere of the dynamicPage, section, input, href, etc. calls that are used in creating an app? I'm cribbing a lot from other apps, but only about 80% understanding what I'm taking from them.