HDI: Examples to work easily with Listbox events
On header click event
{"headerName":"headerLastname", // New property - Header object name "columnName":"lastname", // New property - Column object name "column":2, // New property - Column number "code":42, "description":"On Header Click", "objectName":"EmployeesLB"}
For example, if you set a column object name with a real attribute name of a dataclass (e.g., lastname):
When clicking on the header of the column displaying the employees’ last name, we sort the column on the lastname and firstname attributes:
Form.event:=FORM Event
Case of
: (Form event code=On Header Click)
if (Form.event.columnName="lastname")
Form.employees:=Form.employees.orderBy(Form.event.columnName+", firstname")
End if
End case
On DISPLAY DETAILS event
C_OBJECT($event;$0;$meta)
$event:=FORM Event
$meta:=New object
Case of
: ($event.code=On Display Detail)
If ($event.isRowSelected) //set color when row is selected
$meta.fill:="lightblue"
End if
End case
$0:=$meta
And here’s how the list box looks when rows are selected:
On mouse move EVENT
Another frequently used event is the On Mouse Move event. Below are examples of objects returned by the Form event command when it’s triggered.
You immediately get useful properties to locate where you put your mouse!
The mouse hovers over a header
Form event command returns:
{"area":"header", // The mouse is on a header
"areaName":"headerLastname", // Header object name
"column":2, // Column number
"columnName":"lastname", // Colmun object name
"code":37,
"description":"On Mouse Move",
"objectName":"EmployeesLB"}
The mouse hovers Over a cell
Form event command returns:
{"area":"cell", // The mouse is on a cell
"column":1, // Column number
"row":2, // Row number
"columnName":"firstname", // Colmun object name
"code":37,
"description":"On Mouse Move",
"objectName":"EmployeesLB"}