×
Menu
Index

2.4.2. form / modalform

 
A form displays information and gives the possibility to enter or change the data. A form can be a form opened in a tab page of the application, or it can be a modalform that must be opened in a modal popup.
 
By default a form will use the same space as his parent. If the parent is a tabpage, the form will be opened in the same tabpage. The same if the parent is a modal, the form will use the same modal. However if you want, you can force a modal when you use the modalform.
 
A form can be started from a menu-item, or it can be started as the onclick action of a grid. The result of the action of a button can also be a form.
 

Elements of a form:

 
At the top of a form there are the navigation buttons.
FORM elements can be placed where you want? See Form Elements to see the available possibilities.
This form has some fields/elements and a grid.
 

Definition of a form:

 
As a menu item:
 
{
"title": "Modal Form small",
"endpoint": "/files/klantextra",
"itemid": "1",
"pagetype": "modalform",
"pagesize": "sm",
"id": "samplesmxtra",
"buttons": [
"exit"
]
}
 
  • title: description of the menu-item.
  • endpoint: endpoint of the iAPI to use.
  • itemid: when opening a form from the menu item, you need to know what the id is of the item you want to open.
  • pagetype: form or modalform.
  • pagesize: sm, md, lg of xl.
  • id: unique name
  • buttons: array with the buttons. Since there is no parent, navigation buttons can't be used.
 
 

As onclick action of a grid:

 
"onclick": {
"endpoint": "/files/postnrs/${id}",
"pagetype": "form",
"buttons": [
"add",
"save",
"list",
"previous",
"next",
"exit"
]
}
 
  • onclick: this is the onclick object of the parent, in most cases a grid.
  • endpoint: endpoint of the iApi to use. Important is the use of the ${id} which will be replaced by the id of the selected row.
  • pagetype: form or tabform
  • pagesize: if not used, the default is 'md'.
  • buttons: when the parent of the form is a grid, we can use the navigation buttons.