Accessing ADF Bindings Through Expressions in JSP Pages

As an alternative to working with the Data Control Palette to design your application's UI, you can create your document's ADF binding container and the ADF bindings directly within the Structure window. In a web page, you can then write expressions and use JSTL (JavaServer Pages Standard Tag Library) tags to work with those bindings.

For information about the JavaServer Pages Standard Tag Library, locate this web page in your browser: http://java.sun.com/products/jsp/jstl/reference/docs/index.html.

To reference the bindings and their properties in your web page:

  1. Create the ADF binding container and bindings in the Structure window.

  2. Open the document in the Source code editor, and write expressions that operate on the bindings.

    Note: In the case of Model 1 JSP pages (does not rely on the Struts controller to define the binding container), the following ADF definitions must appear at the top of the web page (before the page definition):

    <%@ taglib uri="http://xmlns.oracle.com/adf/ui/jsp/adftags" prefix="adf"%>
    <adf:uimodelreference model=" pageNameUIModel" />

    The ADF tag <adf:uimodelreference> registers the bindings variable for the ADF model.

  3. To access the value of a value binding object in a JSP page, you would write:

    <c:out value="${bindings.ValueBindingName}"/>

  4. To iterate over the data objects of an iterator binding, your code would look similar to this:

    
    
    
    <c:forEach var="Row" items="${bindings.IteratorBindingName.rangeSet}" >
    
         <tr>
    
           <td><c:out value="${Row.currencyString}" />    </td>
    
           <td><c:out value="${Row['ValueBindingName1']}" /> </td>
    
           <td><c:out value="${Row{'ValueBindingName2']}" /> </td>
    
           <td><c:out value="${Row['ValueBindingName3']}" /> </td>
    
         </tr>
    
       </c:forEach>        

    OR, when you want to use the <adf:RenderValue> tag to render the results:

    
    
    
    <c:forEach var="Row" items="${bindings.IteratorBindingName.rangeSet}"> 
    
          <tr> 
    
             <td> 
    
                <c:out value="${Row.currencyString}"/> 
    
             </td> 
    
             <c:forEach var="attrValue" items="${Row.attributeValues}"> 
    
               <td> 
    
                 <c:out value="${attrValue}"/> 
    
                 <jbo:RenderValue  model="Row.ValueBindingName" /> 
    
               </td> 
    
             </c:forEach> 
    
          </tr> 
    
        </c:forEach>        

    where the property currencyString is defined by the business service in your Model project, in this case a ADF Business Components view object.

  5. To customize a binding, use Code Insight to obtain the properties available for a particular binding.

Notes:

JDeveloper provides Code Insight for Expression Languages in the Code Editor. When editing the source code in the Code Editor the user can type the leading characters of an EL expression, "${". and code completion will be invoked.

JDeveloper also provides Expression Language support in the Property Inspector by using the model binding dialog for model binding dialog for the model property to select an available expression.


To read about data bindings:

About the Oracle ADF Bindings
About the Properties of the ADF Bindings

For information about the role of data bindings in Oracle ADF:

About Oracle ADF Data Controls

 

 

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