I got a lot of questions about table detail stamp how user can set the expanded row to be the current row and closing any other expanded rows (one row will be expanded at a time).
To do that follow this steps:
1- In .jspx select the table and go to property and set RowDisclosureListener to a method in back bean (e.g method name will be rowDisclosureListener)
2- In back bean write this code
3- Run your application and expand any row you will find the expanded row become current row and close any other expanded row
To do that follow this steps:
1- In .jspx select the table and go to property and set RowDisclosureListener to a method in back bean (e.g method name will be rowDisclosureListener)
2- In back bean write this code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void rowDisclosureListener(RowDisclosureEvent rowDisclosureEvent) | |
{ | |
RichTable table = (RichTable) rowDisclosureEvent.getSource(); | |
RowKeySet discloseRowKeySet = table.getDisclosedRowKeys(); | |
RowKeySet lastAddedRowKeySet = rowDisclosureEvent.getAddedSet(); | |
Iterator lastAddedRowKeySetIter = lastAddedRowKeySet.iterator(); | |
if (lastAddedRowKeySetIter.hasNext()) | |
{ | |
discloseRowKeySet.clear(); | |
Object lastRowKey = lastAddedRowKeySetIter.next(); | |
discloseRowKeySet.add(lastRowKey); | |
makeDisclosedRowCurrent(table, lastAddedRowKeySet); | |
AdfFacesContext adfFacesContext = null; | |
adfFacesContext = AdfFacesContext.getCurrentInstance(); | |
adfFacesContext.addPartialTarget(table.getParent()); | |
} | |
} | |
private void makeDisclosedRowCurrent(RichTable table, RowKeySet keySet) | |
{ | |
table.setSelectedRowKeys(keySet); | |
CollectionModel tableModel = (CollectionModel) table.getValue(); | |
JUCtrlHierBinding tableHierBinding = null; | |
tableHierBinding = (JUCtrlHierBinding) (tableModel).getWrappedData(); | |
DCIteratorBinding dCIteratorBindin = null; | |
dCIteratorBindin = tableHierBinding.getDCIteratorBinding(); | |
Iterator keySetIter = keySet.iterator(); | |
List firstKey = (List) keySetIter.next(); | |
oracle.jbo.Key key = (oracle.jbo.Key) firstKey.get(0); | |
dCIteratorBindin.setCurrentRowWithKey(key.toStringFormat(true)); | |
} |
3- Run your application and expand any row you will find the expanded row become current row and close any other expanded row