About DataScope and Provider

Use the dataScope component to register data providers for a UIX component. The dataScope component is automatically added for you when you create a UIX page in JDeveloper.

Requests for data by any children of the dataScope component are first handled by the data providers registered on this component before using other providers.

The data providers are specified using the provider element and data element. You can have any number of data providers. Each data provider is specified by a single data element.

When specifying a data provider, you must provide a name for the DataObject to be serve. The type of the data object is an XML qualified name; that is, it includes a prefix indicating the namespace of the data object (which must have been mapped by an XML namespace definition) and a local name, separated by a colon.

If the local name is "*", this data provider will be asked for all DataObjects in that namespace. If the namespace is omitted, a private namespace will be assumed.

If this data provider returns null, UIX will ask all other eligible DataProviders for this DataObject. Note that implementations should return an empty DataObject instead of null when they want to explicitly return an empty result.


Example:

...
<dataScope currentData="${dat1.formData}">
  <contents>
    <form name="form1">
      <contents>
        <header text="${uix.current.headerText}">
          <contents>
            <radioGroup selectedValue="${uix.current.color}"
                        name="color" 
                        text="${uix.current.name}"
                        value="${uix.current.value}" 
                        childData="${dat1.rad}"/>
            <html:br/>
            <messageTextInput name="stone" prompt="Enter Stone"
                              text="${uix.current.stone}" />
            <html:br/>
            <submitButton text="Submit" />
          </contents>
        </header>
      </contents>
    </form>
  </contents>
  <provider>
    <data name="dat1">
      <inline>
        <formData headerText="Enter Form Data" color="00FF00"
                  stone="Jade" />
        <rad name="Red" value="FF0000" />
        <rad name="Green" value="00FF00" />
        <rad name="Blue" value="0000FF" />
      </inline>
    </data>
  </provider>
</dataScope>
...    

Using DataScope and Provider
Working with Simple and Miscellaneous Components

 

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