Jdev 11.1.1.7
I have an Table with single row selection.
<af:table value="#{bindings.ApplicationsVO11.collectionModel}"
var="row"
rows="#{bindings.ApplicationsVO11.rangeSize}"
emptyText="#{bindings.ApplicationsVO11.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.ApplicationsVO11.rangeSize}"
rowBandingInterval="0" width="920"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.ApplicationsVO11.collectionModel.selectedRow}"
selectionListener="#{viewScope.ApplicationBean.selectApplicationTable_SelectionListener}"
rowSelection="single" id="t1"
disableColumnReordering="true">
...
...
...
once i select the row, the selected row is displayed through output label, saying selected row through selectApplicationTable_SelectionListener method as:
<af:outputText value="#{viewScope.ApplicationBean.selectedApplication}"
id="ot8" partialTriggers="t1"
inlineStyle="font-weight:bold;"/>
public void selectApplicationTable_SelectionListener(SelectionEvent selectionEvent) {
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcItteratorBindings =bindings.findIteratorBinding("ApplicationsVO1Iterator");
GenericTableSelectionHandler.makeCurrent(selectionEvent);
// Get an object representing the table and what may be selected within it
ViewObject voTableData = dcItteratorBindings.getViewObject();
// Get selected row
Row rowSelected = voTableData.getCurrentRow();
if(rowSelected.getAttribute("Applicationname")!=null){
String appName=(String)rowSelected.getAttribute("Applicationname");
log.debug(rowSelected.getAttribute("Applicationname")+" "+appName);
setSelectedApplication(appName);
}
}
Now, I need to have a button which shall make the current selected row of ADF table to the 1st row.
i and able to set the output label through:
setSelectedApplication(row[0].getAttribute("Applicationname")!=null?row[0].getAttribute("Applicationname").toString():"");
but the table's selected row is not changed.
how can i achieve it?