使用af:detailstamp在同一表中显示主数据和明细数据

时间:2019-06-11 08:36:40

标签: oracle-adf jdeveloper master-detail

Photo to describe my problem

我希望在与使用adf应用程序上传的照片相同的表格中显示母版和详细信息 我插入主表视图并在detailstamp中拖动明细表 并使用下面的代码来单击行以显示他的详细信息 但是这里的问题是我只能任意一行打开一行...而且我想同时打开所有行
任何机构都可以帮助我更新此代码吗?

    enter code here    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.toStringForma(true));
 }

0 个答案:

没有答案