tell me more icon Binding the UI to a Managed Bean

In JSF, you send and display dynamic data by binding UI components or component tag attribute values to data in the model layer. This data can be held in any JavaBean within the application. However by registering the bean as a managed bean, at runtime the JSF application automatically instantiates the bean on demand, when the bean is accessed through an expression language (EL) expression from a page for the first time. Property values on the bean can then be displayed, and can also be updated when data from the page is submitted.

In previous cue cards, you have already created the JavaBean and registered it as a managed bean. The JavaBean has two properties: username and email. Bean properties can be bound to component values or component instances. In the example, you will bind the bean properties to component values using the Expression Builder. To open the Expression Builder, you will click the property menu icon dropdown menu at the end of the Value field in the Property Inspector, and then choose Expression Builder.

Property Inspector

You will use the Expression Builder to create the EL expressions for binding the Input Text components' value attributes to the bean properties.

Expression Builder

Some component tag attributes can be bound to methods in JavaBeans. In the example, you will use the Bind Action Property dialog to bind the Command Button component's action attribute to a new method which you will create in the JavaBean.

Bind Action Property dialog

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,