複数値をバインドデータとした繰り返しコントロールを配置しています。
その中に複数値を表示しています。
ここで、繰り返しコントロール内の複数値を選択できるようにしています。
繰り返しコントロール内にチェックボックスを配置したり、ボタンを配置すれば一つ一つを選択するという事はできるのですが(下図参照)、
まとめて全部を選択したり、選択解除したりすることはできません。
繰り返しコントロールの中のソースはこんな感じです。
----------------------------------------------------------------
<xp:repeat id="repeat1" rows="30" var="rowData" indexVar="rowIdx">
<xp:this.value><![CDATA[#{javascript:document1.getItemValue( "multiValue" )}]]></xp:this.value>
<xp:table style="border-top: solid 1px #D9D9D9;width:100.0%">
<xp:tr>
<xp:td style="width:35.0px">
<xp:checkBox id="chkIDs" checkedValue="1"
uncheckedValue="0">
<xp:eventHandler event="onclick" submit="true"
refreshMode="partial" refreshId="tblResult" id="eventHandler1">
<xp:this.action><![CDATA[#{javascript:var chk1 = getComponent( "cfMultiValue" ).getValue();
if ( getComponent( "chkIDs" ).getValue() == 1 ) {
if ( sessionScope.selectedIds == null ) {
var tmpVector:java.util.Vector = new java.util.Vector();
tmpVector.add( chk1 );
sessionScope.selectedIds = tmpVector;
} else {
sessionScope.selectedIds.add( chk1 );
}
} else {
sessionScope.selectedIds.remove( chk1 );
}}]]></xp:this.action>
</xp:eventHandler>
</xp:checkBox>
</xp:td>
<xp:td style="width:35.0px">
<xp:text escape="true" id="cfNo" value="#{javascript:rowIdx+1}">
<xp:this.converter>
<xp:convertNumber type="number" integerOnly="true">
</xp:convertNumber>
</xp:this.converter>
</xp:text>
</xp:td>
<xp:td>
<xp:text escape="true" id="cfMultiValue" value="#{javascript:rowData}">
</xp:text>
</xp:td>
</xp:tr>
</xp:table>
</xp:repeat>
----------------------------------------------------------------
繰り返しコントロールの外から操作できないかと試行錯誤したのですが、出来なさそうです(繰り返しコントロールのコレクション名や索引名は利用できない)。
まとめて選択したり、選択解除したりするのに何か方法はありますか?