jalal rasooly
jalal rasooly

Reputation: 705

how to disable auto selection in oracle adf tables?

in oracle adf when we drop a table from Data Controls to a jsf page,and when we run project a row of table is pre_selected. what should I do that at first time load of the page no rows is selected?
I use jdeveloper 11g R2.

Upvotes: 3

Views: 4881

Answers (3)

user3166325
user3166325

Reputation: 32

You can use property rowSelection="none" for af:table to disable row selection.

-Vinoth

Upvotes: -1

Ashish Awasthi
Ashish Awasthi

Reputation: 83

Refer this, it might help you to disable rowSelection permanently you can set table rowSelection to none and remove it's selection listener and selected rowkey See this -http://amit-adf-work.blogspot.in/2012/09/how-to-disable-adf-default-row.html Thanks

Upvotes: 1

32U
32U

Reputation: 456

Try deleting selectedRowKeys attribute in the table properties:

<af:table value="#{bindings.View1.collectionModel}" 
 ...
     selectedRowKeys="#{bindings.View1.collectionModel.selectedRow}">

If you have a master/child relationship, set refresh condition of child to "ifNeeded".

Once user selects rows and triggers an event, in a backing bean get a handle to the table (various ways to do this), then you can get selected rows using:

Iterator tableIterator = tableHandle.getSeletedRowKeys().Iterator();
if (tableIterator.hasNext()) {
    ...do stuff

Once you've processed the selection(s), you can clear the selection and add partial target to show the table again without selection. First refresh the table iterator, then clear the selected keys:

if (tableHandle.getSelectedRowKeys() != null) {
    tableHandle.getSelectedRowKeys().clear();
}
AdfFacesContext.getCurrentInstance().addPartialTarget(tableHandle);

Upvotes: 5

Related Questions