Note: This procedure assumes inline data (as shown in the example at the end of this topic) has been inserted in the UIX file. The inline data named "demoTableData" provides the data for the rows and columns.
To insert a singleSelection or multipleSelection component:
selection
DataObjectList.
Note: To use data binding, see Data Binding a Component Attribute.
Note: When a table is used in single selection or multiple selection mode, it is possible to use the TableProxy getSelectedRow() method to get the index of the currently selected row or the getSelectedRows() method to get the selected row indices, respectively. The proxied attribute on the table component should be set to true. See About TableProxy for details.
...
<provider>
<data name="demoTableData">
<inline>
<!-- data for 4 rows -->
<demoRowData firstColumnText="First row"
secondColumnText="First Button"
thirdColumnText="First col"
fourthColumnText="111"
isSelected="false"
isDisabled="true" />
<demoRowData firstColumnText="Second row"
secondColumnText="Second Button"
thirdColumnText="Second col"
fourthColumnText="222"
isSelected="true" />
<demoRowData firstColumnText="Third row"
secondColumnText="Third Button"
thirdColumnText="Third col"
fourthColumnText="333"
isSelected="false" />
<demoRowData firstColumnText="4th row"
secondColumnText="4th Button"
thirdColumnText="4th row col"
fourthColumnText="444"
isSelected="false" />
<!-- data for the row headers -->
<demoRowHeaderData headerText="1"/>
<demoRowHeaderData headerText="2"/>
<demoRowHeaderData headerText="3"/>
<demoRowHeaderData headerText="4"/>
<!-- data for the 4 column headers -->
<demoColHeaderData textKey="H1"/>
<demoColHeaderData textKey="H2"/>
<demoColHeaderData textKey="H3"/>
<demoColHeaderData textKey="H4"/>
<!-- formatting information for the rows -->
<demoRowFormats/>
<demoRowFormats displayGrid="false"/>
<demoRowFormats/>
<demoRowFormats/>
</inline>
</data>
</provider>
...
<contents>
...
<table id=tab1
alternateText="No Items Found."
blockSize="25"
tableData="${uix.data.demoTableData.demoRowData}"
columnHeaderData="${uix.data.demoTableData.demoColHeaderData}"
rowHeaderData="${uix.data.demoTableData.demoRowHeaderData}">
<tableSelection>
<!-- SingleSelection. selected takes precedence over selectedIndex. disabled attr is bound -->
<singleSelection selectedIndex="3"
text="Select an item and ..."
selected="${uix.current.isSelected}"
disabled="${uix.current.isDisabled}">
<contents>
<submitButton text="Copy"/>
</contents>
</singleSelection>
</tableSelection>
...
</table>
...
<table id=tab2
alternateText="No Items Found."
blockSize="25"
tableData="${uix.data.demoTableData.demoRowData}"
columnHeaderData="${uix.data.demoTableData.demoColHeaderData}"
rowHeaderData="${uix.data.demoTableData.demoRowHeaderData}">
<tableSelection>
<!-- MultipleSelection, using selected. disabled attr is bound -->
<multipleSelection text="Select one or more rows to ..."
selected="${uix.current.isSelected}"
disabled="${uix.current.isDisabled}">
<contents>
<submitButton text="Delete"/>
</contents>
</multipleSelection>
</tableSelection>
...
</table>
...
<table id=tab3
alternateText="No Items Found."
blockSize="25"
tableData="${uix.data.demoTableData.demoRowData}"
columnHeaderData="${uix.data.demoTableData.demoColHeaderData}"
rowHeaderData="${uix.data.demoTableData.demoRowHeaderData}">
<tableSelection>
<!--multiselect using selection-->
<multipleSelection text="Select one or more rows to ..."
selected="${uix.current.isSelected}">
<contents>
<submitButton text="Delete"/>
</contents>
<selection>
<row isSelected="false"/>
<row isSelected="false"/>
<row isSelected="true"/>
<row isSelected="true"/>
</selection>
</multipleSelection>
</tableSelection>
...
</table>
...
</contents>
...
About SingleSelection and MultipleSelection (TableSelection)
Copyright © 1997, 2004, Oracle. All rights reserved.