viewRootVar property

In a pageHandler part, the viewRootVar property indicates a variable of the type UIViewRoot to represent the root of the page's JSF component tree. Once the viewRootVar variable is defined, you can define other EGL variables to represent JSF components on the page, using the viewRootVar variable to link the variables to the JSF components. For more information, see Accessing a JSF component from a pageHandler.

The viewRootVar property is required for pageHandlers that access the JSF component tree. Also, if the viewRootVar property is specified, the pageHandler must create a variable of the type UIViewRoot with the name specified in the viewRootVar property.

To assign an EGL variable to a JSF component, use the findComponent function on the viewRootVar variable. For example, the following code creates an EGL variable and links it to a text input field using the viewRootVar variable:
myInputField HtmlInputText;
myInputField = myViewRoot.findComponent("form1:text1");

Related concepts
JSF component tree
Overview of EGL properties

Related tasks
Adding JSF component interface support to an EGL Web project
Accessing a JSF component from a pageHandler

Related reference
Component tree access parts

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