下面的代码使我在同一表中显示主表及其详细信息
但是我只能打开任何一行显示按钮的问题
想要可以同时扩展所有行的显示按钮
任何机构都可以帮助我将这段代码更新为适合我的要求吗?
public void rowDisclosureListener(RowDisclosureEvent rowDisclosureEvent){ RichTable表=(RichTable)rowDisclosureEvent.getSource(); RowKeySet prepareRowKeySet = table.getDisclosedRowKeys(); RowKeySet lastAddedRowKeySet = rowDisclosureEvent.getAddedSet();迭代器lastAddedRowKeySetIter = lastAddedRowKeySet.iterator(); 如果(lastAddedRowKeySetIter.hasNext()){ discoverRowKeySet.clear(); 对象lastRowKey = lastAddedRowKeySetIter.next(); discoverRowKeySet.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(); 迭代器keySetIter = keySet.iterator();列出firstKey =(列出)keySetIter.next(); oracle.jbo.Key key =(oracle.jbo.Key)firstKey.get(0); dCIteratorBindin.setCurrentRowWithKey(key.toStringFormat(true)); } enter link description here