You can set an ADF table binding on this UI control that you insert from the Data Control Palette:
A table binding lets users view a table consisting of attribute names (column headers) and values from a data collection. You use the table binding editor to select the data collection and attributes to display.
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 in the table. Another control hint lets you change the label displayed by the column header for each attribute.
To set a table binding:
In the top portion of the Data Control Palette, select the desired data collection to display.
From the Data Control Palette, add the table control to the data panel.
Note: When you use the Data Control Palette to drop a JTable control into a JClient panel or form, the table will initially display all attributes (columns) of the selected collection. To modify the table's list of display attributes, you can use the Table Binding Editor, however, the changes will not be reflected immediately in the Visual Editor. In order to synchronize the Visual Editor with the table's binding information (saved in the form or panel's UIModel.xml file), you can either recompile the class file, or you can merely resize the table in the Visual Editor.
From the Structure window, display the table binding editor for the desired control.
In table binding editor, select the Data C ollection that contains the attributes you want to display in the table.
Tables you create must be based on scalar attributes of a collection
or structured object. For example, if you attempt to drop the
return() method of a complex collection (contains arrays) as
a table, the collection's attributes will not be displayed because
they are defined by accessors. Whereas, you can drop individual
accessors of the collection as a table because they define
attributes.
In the Available Attributes list, select the attribute to display and add it to the Display Attributes list. You may add as many attributes as desired to the Display Attributes list.
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 previously made attribute selections. Before you change the iterator selection, take note of the original attribute selections. If you need to, you can press Cancel to exit the binding editor without updating the original attribute selections. 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.
To rearrange the columns of the table, select an attribute in the Display Attributes list and click a Move Selection arrow button to reposition the attribute in the list.
The position of the attribute from top to bottom in the list determines the position of the columns in the table from left to right.
Click OK to save the binding settings.
JDeveloper adds the setModel() method in the jbInit()
method to create the control binding. For example, after inserting a table
from the Data Control Palette, the method which references
DataControlId to specify the meta-data, looks like this:
myTable.setModel((TableModel)panelBinding.bindUIControl("DataControlId",
myTable));
Meta-data for the new binding appears in the binding definition file (
UIModel.xml):
<DCControl
id="MyDataControl"
DefClass="oracle.jbo.uicli.jui.JUTableDef"
SubType="DCTable"
IterBinding="DataCollectionIteratorId"
ApplyValidation="false"
<AttrNames>
<Item Value="MySelectedAttribute1" />
<Item Value="MySelectedAttribute2" />
...
</AttrNames>
</DCControl>
About the ADF Bindings and Swing Controls
Copyright © 1997, 2004, Oracle. All rights reserved.