First page Back Continue Last page Graphics

Adding UI Code


Adding UI Code

You can add UI code to the task flow by using managed beans. You learn how to code and register managed beans in the lesson titled “Responding to Application Events.” However, a brief mention of managed beans is included in this lesson on task flows because managed beans are specific to task flows and are configured in the task flow’s XML file.

Managed beans are Java classes with a no-argument constructor that you register with the application in task flow .xml files. When the JSF application starts up, it parses these files and makes the beans available to be referenced in EL expressions or Java code, enabling access to the beans’ properties and methods.

Whenever a managed bean is referenced for the first time and it does not already exist, the Managed Bean Creation Facility instantiates the bean by calling the default constructor method on the bean. If any properties are also declared, they are populated with the declared default values.