You can set an ADF formatted text edit binding on this basic UI component that you insert from the Data Control Palette:
The formatted text edit binding lets the user view and edit the value of a single attribute defined by a data collection. You use the formatted edit field binding editor to select the data collection and attribute.
Note: In an ADF Business Components project, you can make attribute values updateable by setting a control hint on the attribute. In that case, users will be able to edit the updateable attribute's values directly.
To set an formatted text edit binding:
In the top portion of the Data Control Palette, select the desired attribute to display.
Be sure to select an attribute and not a data collection.
From the Data Control Palette, add the desired control to the data panel.
From the Structure window, display the formatted text edit binding editor for the desired control.
In the formatted text edit binding editor, select Attribute in the FormatBinding list, and select the Data Collection that contains the attribute you want to display.
In the Attribute list, select a single attribute to display as the value of the control.
If the iterator dropdown list already displays a named iterator to access the selected data collection, leave the selection unchanged. If the dropdown appears empty, click New and create the iterator so it appears in the dropdown list.
Warning: Changing the iterator selection in the dropdown list will remove the previously made attribute selection. Before you change the iterator selection, take note of the original attribute selection. If you need to, you can press Cancel to exit the binding editor without updating the original attribute selection. If you create the binding and decide not to use it, you can remove the unused iterator binding from the binding definition file; pressing Cancel in the editor will not automatically delete the binding.
Select Format in the FormatBinding list, and select the Formatter to use.
Click OK to save the binding settings.
JDeveloper adds the setDocument() method in the
jbInit() method to create the control binding. After inserting a
formatted text edit from the Data Control Palette, the method which
references DataControlId to specify the meta-data, looks
like this:
jFormattedTextField.setDocument((Document)panelBinding.bindUIControl("DataControlId",
jFormattedTextField));
Meta-data for the new binding appears in the binding definition (
UIModel.xml):
<DCControl
id="SameAsAttributeName"
DefClass="oracle.jbo.uicli.jui.JUFormattedTextFieldDef"
SubType="DCFormattedTextField"
IterBinding="DataCollectionIteratorId"
ApplyValidation="false"
ApplyActiveFormatter="0"
<AttrNames>
<Item Value="MySelectedAttribute" />
</AttrNames>
<DateFormatDef
FormatString="MM/dd/yyyy" >
</DateFormatDef>
<MaskFormatDef
FormatString="****"
USPhoneNumberSelected="false"
SocSecNumberSelected="false" >
</MaskFormatDef>
</DCControl>
About the ADF Bindings and Swing Controls
Copyright © 1997, 2004, Oracle. All rights reserved.