Setting a JSP Control Type for Business Components Attributes

When you create an ADF-enabled web page or JClient panel for ADF Business Components, some attribute values may display in text area fields instead of single-line text edits. You can control which control type is used by setting the control type for individual Business Components attributes.

Note: The threshold for switching from a text edit to a text area control is 30. When an attribute in Business Components maps to a data type that has a character length or precision (for example, in the case of integers) greater than 30, then the web page displays the value in a text area control.

To view the precision specified for the attribute's data type:

  1. In the Systems Navigator, expand the entity object node that defines the desired Business Components attribute.

  2. Double click the .xml node to view the XML definition for the entity object.

  3. Scroll the XML file until you find the attribute definition, and note the Precision value of the attribute. For example, the XML definition for the following Status attribute, mapped to type oracle.jbo.domain.Number, shows a default precision of 38. Because this precision exceeds the threshold of 30, the Business Components JSP will use, by default, a text area control to render the Status value:

    
    	
    
    <Attribute 
    
          Name="Status" 
    
          Precision="38" 
    
          Scale="0" 
    
          Type="oracle.jbo.domain.Number" 
    
          ColumnName="STATUS" 
    
          ColumnType="NUMBER" 
    
          SQLType="NUMERIC" 
    
          TableName="CHECKIN_APP" > 
    
          <DesignTime> 
    
            <Attr Name="_DisplaySize" Value="0" /> 
    
          </DesignTime> 
    
     </Attribute>         
  4. Close the XML file for the entity object.

To set the attribute's display control type to a text edit field:

  1. Open the Create Attribute wizard for the attribute and select Control Hints.

  2. Select Edit from Control Type on the control hints page.

  3. Edit Display Width to use the precision you obtained for the attribute in the entity object's XML definition. (Based on the above example, to display the Status attribute value as a text edit, you would enter 38.)

  4. Enter the value 1 for Display H eight. A value of 1 forces the web page to use a single line text edit.

  5. Click OK to save the attribute with the new control type.


About Control Hints for Business Components Clients

 

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