Component tree access parts

To access a JSF component on a Faces JSP page, you first define an EGL variable of that component's type. Then, you assign that variable to the JSF component. The source assistant can create this code for you most of the time. For more information, see Accessing a JSF component from a pageHandler.

Use the following syntax to assign a variable to a JSF control:
   controlVar = findComponent(controlName);
controlVar
The variable of the appropriate type
controlName
A string variable or literal that identifies the control. In most cases, you specify a series of JSF control IDs, starting with the ID of the top-level form in the component tree and continuing to the ID of the specific control, with each ID separated from the next by a colon (:). The example used the following string to reference a text box named text1 in a top-level form named form1:
  "form1:text1"

Once you have assigned the variable to the JSF control, you can use functions on that variable to make changes to the JSF component. Different types of JSF controls accept different functions.

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

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