Tuesday, December 21, 2010

ADF Select the first row in a rich table programmatically

Object rowKey = resultTable.getAttributes().get("scrollTopRowKey");
RowKeySet rks = resultTable.getSelectedRowKeys();
rks.clear();
rks.add(rowKey);

4 comments:

  1. Hi Could you please elaborate on the example.

    i have a similar requirement where i have to make the first row as default when the table is populated by the query panel.

    i do not know where to place this code.

    Please help

    ReplyDelete
    Replies
    1. I usually do this on the queryListener in the af:query. Have you tried a displayRow="first" on you table it may be simpler depending on your requirement.

      Delete
  2. can i use:
    Object rowKey = resultTable.getScrollTopRowKey();
    instead of:
    Object rowKey = resultTable.getAttributes().get("scrollTopRowKey");?

    ReplyDelete
  3. I want the first row in my manageBean

    ReplyDelete