Object Data Provider

See Also

Use this data provider to wrap an individual JavaBean instance, making its properties available to value binding expressions. The following example describes how you might do this.

You have a JavaBean class named User that has a String property fullName, among others. Also, you have a user property on SessionBean1 representing the logged in user. On an Edit User Profile page, you want to bind a text field to this property, but you want to use a data provider because you might change your mind later and bind directly to a database row representing this user.  You do this as follows:

  1. Make sure there is a user property on SessionBean1 as described above.
  2. Drop a text field on the page, which is named textField1.
  3. Drop an Object data provider on the design surface, which is named objectDataProvider1.
  4. Bind the Object data provider to the appropriate user instance by selecting the user (SessionBean1) option from the drop down list.
  5. Right-click the text field and choose Bind to Data.
  6. In the Bind to Data dialog box, select the Bind to Data Provider tab, and then select  objectDataProvider1 and select the fullName field from this data provider.

The resulting binding expression will be something like the following:
    #{Page1.objectDataProvider1.value['fullName']}

See Also
Object Data Provider Properties Window
About Components and Data
About Binding Components to Data
About Components

Legal Notices