< Back
You are here:
Print

3.2.03 Start a form

When starting a form you need to send the content of the form to BOA. With the first request the parameter &labels=1 will be added to the endpoint url.

Sample: http://url/customers?key=xxx&labels=1 the labels=1 will be send to get the information about the layout of the form. This will be asked only once, but you can send it each time if you wish.

Response

In the response you need to add the labels section. With this array you can control the layout of each form. A second array is to define the number of blocks you want to have on your form. See the information about the responsive design.

{
“file”: “personeel”,
“labels”: [
{
“display”: “”,
“fieldname”: “id”,
“length”: 8,
“inputtype”: “hidden”,
“block”: 1
},
{
“display”: “Code:”,
“tooltip”: “”,
“fieldname”: “persoon”,
“length”: 2,
“inputtype”: “text”,
“block”: 1,
“newline”: true,
“labelwidth”: 2,
“fieldwidth”: 2,
“fieldheight”: 1
},
{
“display”: “Naam:”,
“tooltip”: “”,
“fieldname”: “naam”,
“length”: 20,
“inputtype”: “text”,
“block”: 1,
“newline”: true,
“labelwidth”: 2,
“fieldwidth”: 6,
“fieldheight”: 1
}
],
“blocks”: [
{
“width”: 12
}
],
“data”: []

The following is needed in the reponse when the labels=1 was in the request.

  • file: name of the database table.
  • autosave: can be set to true or false. When true, the popup to save won’t be asked after a change. Default is false.
  • labels: Array with json objects to define all the elements of the form.

The objects in the labels array have all the data for each element in the form. The content of the object can be different according to the elemen. See the description of all the elements in chapter 4.

  • display: text to display in the form as label.
  • tooltip: tooltip to display if you hover above the element.
  • fieldname: name for the field that contains the data.
  • length: max. lenght of the field is this is defined in the table. BOA will not accept input which is longer.
  • inputtype: type of the form element. Up to 20 type available.
  • block: number of the block it must be shown in.
  • newline: if a newline must be started in the form.
  • labelwidth: number of columns in the block to be used for the label.
  • fieldwidth: number of columns in the block for the input field.
  • fieldheight: height of the element. Used for buttons, multiline edit, draw, picture, …

In the above sample the labels array starts with the ID. The ID is ALWAYS needed when you define a form. Each data-row always has an ID. In the form it must be defined. You can define it as a hidden fieldtype. It will never be displayed, but this ID will be used when you edit data.

Data array.

The structure of the objects in the data array, must correspond with the definition in the labels section. Otherwise if there are fields missing, the system will block.

“data”: [
{
“id”: “5”,
“persoon”: “BB”,
“naam”: “Bart”
},
{
“id”: “4”,
“persoon”: “BO”,
“naam”: “Bo”
},
{
“id”: “11”,
“persoon”: “FA”,
“naam”: “Fran”
},…
]

Each objects contains all fields, and the ID. This is absolutely needed to work with BOA.

This data sample has all the fields as defined in the labels section above.

As you can see the structure for the data is the same for grids and forms.

Previous 3.2.02 Responsive forms
Table of Contents