Setting JSF data table properties

You can change the some of the properties of a JSF data table on a Faces JSP page with EGL code.

This task has the following prerequisites. For more information, see Accessing a JSF component from a pageHandler.
Follow these steps to assign or remove an event handler from a JSF component:
  1. On a blank line inside a function in the pageHandler, press Ctrl+Shift+Z. The EGL Source Assistant window opens, displaying the JSF components on the page.
  2. In the EGL Source Assistant window, select the JSF data table component you want to access.
  3. Click OK.
    The EGL source assistant adds two lines of EGL code to the pageHandler. The first line defines an EGL variable of the type that matches the JSF component that you selected. The second line associates that variable with the JSF component. For example, the code to access a JSF input text component might look like this:
    table1 HtmlDataTable;
    table1 = viewRoot.findComponent("table1");
  4. Using the EGL variable created by the source assistant, change the properties of the data table. For example, to change the table's rowClasses property 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");

Related concepts
JSF component tree
viewRootVar property

Related tasks
Adding JSF component interface support to an EGL Web project
Accessing a JSF component from a pageHandler
Changing the style class of a JSF component
Changing the style of a JSF component
Changing the target of a JSF link
Enabling or disabling JSF components
Setting the size of a JSF image
Setting event handlers for a JSF component

Related reference
Component tree access parts

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.