あまり汚れない回避策を思いつきました。RichTable オブジェクトから選択した行のセットをいつでも取得できることを考えると、すべての行を一時的に選択済みに設定して、選択した行セットを取得できると判断しました。
警告: 現在のアプリケーションでは、扱っているテーブルは選択を許可するように設定されていないため、更新が完了した後に破棄されるため、選択をクリアすることを心配する必要はありません。
// set all rows in the table to selected so they can be iterated through
selectAllRowsInTable( rolesGrantedAndAvailableTable );
RowKeySet rSet = rolesGrantedAndAvailableTable.getSelectedRowKeys();
Iterator selectedEmpIter = rSet.iterator();
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding roleIter = bindings.findIteratorBinding("usersGrantedAndAvailableRolesView1Iterator");
RowSetIterator roleRSIter = roleIter.getRowSetIterator();
// iterate through all rows checking checkmark status and deciding if the roles need to be granted, revoked, or no action be taken
while(selectedEmpIter.hasNext())
{
// Do your stuff with each row here
}
AMISブログで見つけたすべての行を選択する機能は
public void selectAllRowsInTable( RichTable rt )
{
RowKeySet rks = new RowKeySetImpl();
CollectionModel model = (CollectionModel)rt.getValue();
int rowcount = model.getRowCount();
for( int i = 0; i < rowcount; i++ )
{
model.setRowIndex(i);
Object key = model.getRowKey();
rks.add(key);
}
rt.setSelectedRowKeys(rks);
}