This dialog box enables you to associate a data provider or object with the default component property that displays information in the component, such as the text
property of a Button component or the url
property of an Image component. You can create this association if you want to change the appearance of the component at runtime. If the default display property can be used to send a value entered by the user to the server, then binding this property can also save that value on the server. For example, the text
property of a Text Field picks up a value entered by the user and can also be used to display a default value to the user.
The dialog box opens when you right-click and choose Bind to Data with a Basic or Composite component that has a default property, like the text
property of a Button, that displays a single data item, not a list or table. The components that open this dialog box include Alert, Breadcrumbs, Button, Calendar, Checkbox (single, not in a group), File Upload, Hidden Field, Hyperlink, Image, Image Hyperlink, Inline Help, Label, Password Field, Radio Button (single, not in a group), Static Text, and Text Field.
You can tell which property is being set by looking above the top field of the dialog box at the line of text that says "Current property-name property setting". The top field itself shows you the current setting for the property, if any.
To set a binding, first choose the tab that does the kind of binding you want, Bind to Data Provider or Bind to Object.
This tab enables you to bind the component property to a database column that you added to the page prior to accessing this dialog box.
If the displayed data provider is not the one you want to use, select another data provider from the Choose a Data Provider drop down list. If you do not see the data provider listed, you must add a database table, as appropriate for your application.
When you have selected the data provider you want, the Data Field list is populated with items from the data provider. These items represent database columns. Select the item that will control what is displayed in your component.
When you select a data field item, the dialog box's top entry field is filled in for you with a JavaServer Faces expression that references the item you selected.
When you are satisfied with your selection, click OK to apply the binding to the component's property.
This tab enables you to bind the component property to a JavaBeans property. For example, you might want to bind the component property to a property of SessionBean1 to persist a value across multiple web pages accessed by a single user, or you could bind the component property to a property of ApplicationBean1 to share a value with all users of an application. In the Bind to an Object tab, you can see a tree view of all managed beans and their properties. You bind to a property by selecting the property and clicking OK.