You can also use buttons, which @arnb educated me on recently. If you have a button press that is required to initiate your action, you know specifically which one was pressed.
You declare them like this, and they submit the dynamicPage when pressed.
input(name: "importProntoCodes", type: "button", title: "Press to import entered codes")
Then you need a handler like this:
void appButtonHandler(btn)
{
// btn is string name of the button input
}
In the app that I posted here, I declare the button inputs on the dynamicPage, and I use appButtonhandler to set a flag in my @Field Static Map.
Then in the code that executes in my dynamicPage I check whether the entry is set in the Map, and if so I do the action that the button press was supposed to initiate, then I clear the entry from the Map.