注意: この手順では、このトピックの最後に記述されているインライン・データがUIXファイルに挿入されているものとして説明しています。demoTableDataというインライン・データでは、行と列のデータが提供されます。
singleSelectionまたはmultipleSelectionコンポーネントを挿入するには、次のようにします。
selection
dataObjectListから表の行の選択状態を取得できます。
注意: データ・バインディングを使用する場合には、「コンポーネントの属性のデータ・バインディング」を参照してください。
注意: 単一選択モードまたは複数選択モードで表を使用しているときには、それぞれ、TableProxyのgetSelectedRow()メソッドを使用して現在選択されている行の索引を取得し、getSelectedRows()メソッドを使用すると選択した行の複数の索引を取得できます。tableコンポーネントのプロキシ属性をtrueに設定する必要があります。詳細は、「tableProxyについて」を参照してください。
...
<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>
...
singleSelectionおよびmultipleSelection(tableSelection)について
Copyright © 1997, 2004, Oracle. All rights reserved.