getDropDown(id).settings.callback( command )
(since PennController 1.5)
or getDropDown(id).settings.callback( command1, command2 )
(since PennController 1.5)
Will execute the command(s) whenever an option is selected from the drop-down list.
Example:
[js highlight=”7-18″ try=”true”]newText(“The weather is”)
.settings.after( newDropDown(“temp”,”…”).settings.add(“cold”,”warm”,”hot”) )
.settings.after( newText(“implicature”, “implies that the weather is …”) )
.print()
,
getDropDown(“temp”)
.settings.callback(
getDropDown(“temp”)
.test.selected(“warm”).success(
getText(“implicature”).settings.text(“implicates that the weather is not hot”)
)
.test.selected(“hot”).success(
getText(“implicature”).settings.text(“implies that the weather is not cold”)
)
.test.selected(“cold”).success(
getText(“implicature”).settings.text(“implies that the weather is not even warm”)
)
)[/js]
Prints The weather is … implies that the weather is … onto the page, where the first occurrence of … is a drop-down list containing the options cold, warm and hot. Upon selection of the option, the continuation will be modified accordingly to the selected option.