You can change some of the properties of a JavaServer Faces (JSF)
data table on a Faces JSP page with EGL code.
To change the properties of a JSF data table control:
- On a blank line inside a function in the JSF Handler, press Ctrl+Shift+Z.
The EGL Source Assistant window opens, displaying the JSF controls
on the page.
- In the EGL Source Assistant window, select the JSF data table
control that you want to access.
- Click OK.
The EGL source assistant adds
two lines of EGL code to the JSF Handler. The first line defines an
EGL variable of the type that matches the JSF control that you selected.
The second line associates that variable with the JSF control. For
example, the code to access a JSF input text control might look like
this:
table1 HtmlDataTable;
table1 = viewRoot.findComponent("table1");
- Using the EGL variable that the source assistant created, change
the properties of the data table. For example, to change the rowClasses
property of the table to the style class MyRowClass1,
add this code:
table1.setRowClasses("MyRowClass1");
To
make the rows of the data table alternate between the two style classes
MyRowClass1 and
MyRowClass2,
add this code:
table1.setRowClasses("MyRowClass1, MyRowClass2");