我需要使用trinidad标记扩展/折叠表的行内容。尝试过以下方法
方法:
以下是jspx和MgdBeans的代码片段。
jspx的片段
<tr:table id="offers" var="offer"
rendered="#{oMgdBean.offerList != null}"
value="#{oMgdBean.filteredOList}" varStatus="stat"
binding="#{cpMgdBean.oTable}"
rowDisclosureListener="#{cpMgdBean.handleDisclosureEvent}"
width="100%">
<tr:column align="start" styleClass="oLink">
<tr:panelHorizontalLayout rendered="#{offer.id != 'no_offer' and !empty offer.id}">
<tr:commandLink id="oLink" text="#{offer.name}" >
<tr:setActionListener from="#{offer.name}"
to="#{pageFlowScope.propName}" />
<tr:setActionListener from="#{offer.id}"
to="#{pageFlowScope.propId}" />
</tr:commandLink>
</tr:panelHorizontalLayout>
</tr:column>
<f:facet name="detailStamp" rendered="#{offer.id != 'no_offer' and !empty offer.id}">
<tr:panelHorizontalLayout halign="center">
<tr:table styleClass="priorities" var="customerPriority" value="#{pageFlowScope.customerPriorityMap[offer.id]}" >
<!-- Display the data here -->
</tr:table>
</tr:panelHorizontalLayout>
</f:facet>
</tr:table>
MgdBean片段
public void handleDisclosureEvent(org.apache.myfaces.trinidad.event.RowDisclosureEvent event) throws ServiceException{
//get prop id from row
RowKeySet AddedRowKeys = event.getAddedSet();
List newList;
Iterator rowKeysIter = AddedRowKeys.iterator();
Product currentProp = null;
while(rowKeysIter.hasNext()){
//offerTable is instance of CoreTable
offerTable.getComponent().getRowCount().setRowKey(rowKeysIter.next());
currentProp = (Product)offerTable.getComponent().getRowData();
if(null != currentProp){
//check map for entry
if(pageFlowMap.containsKey(currentProp.getId())){
return;
}
newList = getData(currentProp);
pageFlowMap.put(currentProp.getId(), newList);
}
}
}
当前方法面临的问题:
任何帮助将不胜感激。