FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
Row rw = rowBinding.getRow();
or
RichTable _table = (RichTable ) selectionEvent.getSource();
CollectionModel model = (CollectionModel ) _table.getValue();
FacesCtrlHierBinding _binding = (FacesCtrlHierBinding) model.getWrappedData();
FacesCtrlHierBinding.FacesModel treeModel = (FacesCtrlHierBinding.FacesModel) _binding.getTreeModel();
treeModel.makeCurrent(selectionEvent);
On first sight FacesCtrlHierBinding exposes the convenient methods you need. But the solution is invalid. You shouldn't use FacesCtrlHierBinding and FacesCtrlHierNodeBinding directly cause they are internal ADF Faces component model for tree, table and treeTable.
You can use EL in Java: #{bindings.myEntityView.treeModel.makeCurrent}:
- Easy to use
- Does it right for all Data Control types
- Requires knowledge about the PageDef definition
Use JUCtrlHierBinding or JUCtrlHierNodeBinding
- No knowledge about binding layer is required
- Needs more code to write
RichTable _table = (RichTable ) selectionEvent.getSource();
CollectionModel model = (CollectionModel ) _table.getValue();
JUCtrlHierBinding _binding = (JUCtrlHierBinding) model.getWrappedData();
DCIteratorBinding iteratorBinding = _binding.getDCIteratorBinding();
Object _selectedRowData = _table´.getSelectedRowData();
JUCtrlHierNodeBinding node = (JUCtrlHierNodeBinding) _selectedRowData ;
Key rwKey = node.getRowKey();
iteratorBinding.setCurrentRowWithKey(rwKey.toStringFormat(true));
Hi I have a tree table. I want to get the multiple selected values.I have created the tree table programmatically. Can you tell me how can I get the selected values.
ReplyDeleteADFUtils.invokeEL("#{bindings.Employee1.collectionModel.makeCurrent}", new Class[]{SelectionEvent.class}, new Object[]{selectionEvent});
ReplyDelete