Autoload and Data Loader Examples
A Data Loader is used to fetch the value of a property. Data Loaders are typically used for properties that represent a calculated, auto-generated or queried value. This Data Loader property can be set to any component such as Widget or any UI component in widget.
Some examples of Data Loader
Suppose you want to display the names of all employees in a list (combo box):
Steps:
Create one DB action
searchallemployeeswith the query:select id, employeename from employee;Create one UI widget and add one section in it. Also, add a UI component of type select under this section. Name it Employees.
Drag the DB action created in step 1 into the newly created widget.
Set properties of the component Employee as follows:
Data Mapping:
Data Bean Path =
employeedatapath1(you can specify any name)Field Name =
empname(you can specify any name)Autoload Data = check this so that employee names are automatically loaded in the combo box
Selection Options:
Selection Options Type = select option
"Dynamic"Selection Options Loader = select action dragged in step 3 from the list
Selection Options Path =
employeedatapath2(you can specify any name)Selection Options Label Field =
employeename(parameter from the query in step 1; used for displaying values in the combo box)Selection Options Value Field =
id(unique key from the employee table; used as a parameter for further processing)
Click SAVE.
Create and run the Web Application that includes the UI widget created in step 2. You should see all employees displayed in the combo box Employees.