With a dropdown a user gets a list of possible selections after entering data into the field.
Dropdown for Country codes.
Data part
With a dropdown you have an element with two parts. You need to define the element itself, and you need to define where BOA must get the data. There must be an endpoint which will return the data. As soon as the user enters data into the element of the dropdown, the entry is send to the endpoint. The result appears in the list box.
{
"display": "",
"tooltip": "",
"fieldname": "land",
"length": 3,
"inputtype": "dropdown",
"grid": "landcodes",
"data": {
"endpoint": "\/files\/landcodes",
"buttons": [],
"file": "landcodes",
"fieldname": "code",
"pagetype": "",
"pagesize": "",
"hidefilter": false,
"onclick": {
"endpoint": "",
"pagetype": "",
"pagesize": "",
"hidefilter": false,
"buttons": []}
},
"block": 1,
"newline": false,
"labelwidth": 0,
"fieldwidth": 2
}
inputtype: dropdown
data: this object contains the information to get the data to fill the listbox. After each character the user entered, this endpoint will be called with the data as a key. This way the iAPI knows what to return.
endpoint: endpoint to be used to get the data.
buttons: not used.
file: name of the file you want to search.
fieldname: name of the field to return after selecting a row in the list box.
Remark: notice that the name of the field to return, don't need to be the same name as the field to save. In this sample the field land will be filled with the content of the field code.
The other tags aren't used in this case, but you need to send them!
In the above sample and screen, this is the request BOA has been send to the iAPI after the user has entered the letter 'n'.
files/landcodes?key=n&headers=1
The key contains the entered value, in this case the letter 'n'.
As an extra parameter BOA also request for the headers. Since they are not shown, you can ignore them.