binding ui components to data. adding ui components to the page you can create components on a page...

12
Binding UI Components to Data

Upload: corey-harper

Post on 02-Jan-2016

270 views

Category:

Documents


3 download

TRANSCRIPT

Binding UI Components to Data

Adding UI Components to the Page

You can create components on a page by:• Dragging a component from the Component Palette• Using the context menu in editor or Structure window• Dragging a data element from the Data Controls panel

Using the Component Palette

• Drag the component from the Component Palette:

Using the Context Menu

Using the Data Controls Panel

The Data Controls panel:• Is a visual representation of your business

service that contains:– Methods– Parameters and results– Attributes– Collections– Built-in operations

• Provides automatic data binding for any business service; for example, there automatically is a data control for every ADF BC application module

Describing the ADF Model Layer

• Data controls describe the public interface of a business service.

• Bindings connect UI components to data or actions.

• Data controls and bindings are defined by using XML metadata.

Types of Data Bindings

• Iterator Binding: Keeps track of the current row in a data collection

• Value Binding: Connects UI components to attributes in a data collection; examples: attribute binding, tree binding, list binding, table binding

• Action Binding: Invokes a method or operation

Using Expression Language (EL)

Expression Language and Bindings

• Data binding expressions are written using EL.• They are evaluated at run time to determine what data to display.• ADF EL expressions typically have the form:

#{bindingVariable.BindingObject.propertyName}– Example of an inputText component in a JSF page:

<af:inputTextvalue="#{bindings.Ename.inputValue}”label="#{bindings.Ename.label}”required="#{bindings.Ename.mandatory}">

Opening a Page Definition File

The page definition file <pagename>PageDef.xml (for example, browseOrdersPageDef.xml):

• Is created automatically when you adda databound component to a page

• Contains all the binding definitionsfor a page

To open a page definition, perform the following steps:1. Right-click the page in the editor or

Application Navigator.2. Select Go to Page Definition.

Editing Bindings in a Page Definition File

Tracing Data Binding:From Database to Databound Components