Creates a button on the interview, which in itself has no functionality, but provides a method to initiate other commands.
Examples of usage:
Sometimes, the template author would like to let the user initiate actions (database retrieval, modification of data elements, etc.) explicitly. This is the purpose of the Button command.
Use a button to input today’s date:
Use a button to retrieve information from a data source:
There are some powerful commands in XpressDox which enable the template author to retrieve data or modify the interview when the focus moves from one control on the interview to another. These are – OnExitSet, LinkToDatasource, and similar commands. The command
«Button(XXX)»will result in a button appearing on the interview. On its own, it means not very much, because clicking it will result in no action. But as soon as one of the actions above is linked to it, such as
«LinkToDataSource(XXX,Accounts,,id=<AccountNumber>)» then the action defined by that LinkToDataSource command will be executed – in this case, an account row whose Id is in the AccountNumber data element will be retrieved from the Accounts data source, and the data elements defined in that row will populate the data set (and the interview where relevant).
The data element XXX is really a kind of placeholder and will be removed from the data set as soon as the interview is complete. So don’t be tempted to make it one of the data elements that will appear in the assembled template.
Note that the actions associated with OnExitSet, LinkToDataSource, and LinkToOtherData will be executed when the user clicks the button in the interview, not when the focus leaves the control, which is the usual way that those actions are triggered.