×
Menu
Index

4.1.17. searchedit button

 
A searchedit element has two buttons:
 
 
Form with searchedit.
Note: Group and Brand are search buttons.
 
To define the searchedit element there is a data object, to define the relation to another table. In this data object, there are two endpoints used:
 
{
"display": "Supplier:",
"tooltip": "Name of the supplier.",
"fieldname": "lever_naam",
"length": 40,
"inputtype": "searchedit",
"grid": "suppliers",
"data": {
  "endpoint": "\/tabfiles\/lever",
  "buttons": ["select","add","edit","exit"],
  "file": "suppliers",
  "fieldname": "naam",
  "pagetype": "tabgrid",
  "pagesize": "xl",
  "hidefilter": false,
  "onclick": {
    "endpoint": "\/tabfiles\/lever\/${id}",
    "pagetype": "tabform",
    "pagesize": "",
    "hidefilter": false,
    "buttons": ["save","exit"]
  },
  "onedit": {
    "endpoint": "\/tabfiles\/lever\/${nummer}",
    "pagetype": "modaltabform",
    "pagesize": "xl",
    "buttons": ["save","exit"]
  }
},
"block": 1,
"newline": true,
"labelwidth": 2,
"fieldwidth": 10
},
 
 
  • inputtype: searchedit to have two buttons.
  • grid: name of the grid to open.
  • data: object to know where to search in the grid. This data defines where to search, what to show, which buttons.
When the user clicks on the search button, the following will start according to the data object:
  • endpoint: the endpoint to send the request to.
  • buttons: which buttons to make available in the popup.
  • file: name of the file/grid.
  • fieldname: name of the field of the form to use for the search in the grid. The content of that field will be the 'key' to search for.
  • pagetype: how the grid must appear, the modalgrid is the most logical, but other types can be used.
  • pagesize: size of the page to open.
  • hidefilter: show the filter or not.
  • onclick: Action to make when the user selects a row in the grid.
To provide the functionality to add or edit data during searching, you can define the onclick endpoint of the grid, so you define the form to open. When there is no onclick, a search can be done to select a row, but there will be no edit possibilities.
  • endpoint: of the form.
  • pagetype and pagesize: always needed for a form.
  • buttons: for the navigation. Since the parent is a grid, you can also use the next/previous buttons.
  • onedit: Action to make when the user clicks on the edit button.
  • endpoint: of the edit form.
  • pagetype and pagesize: always needed for a form.
  • buttons: for the navigation. Since the parent is a grid, you can also use the next/previous buttons.
 
 
 
 
After selecting a supplier in the popupgrid, the fieldname lever_naam will be filled according to the info in the data object. The data from the fieldname naam from the file suppliers will be saved into the fieldname lever_naam.
 
With the searchedit BOA provides a powerfull element to your application. In a lot of cases the info on the screen is the value of a lookup. In combination with a hidden field, you can display the value you want, and save a corresponding ID which isn't shown. This way it is easy for your endpoints to update the database without any problem.