I also have faced the same problem.. I think this will surely solve your problem.
You have to do these things:
Maintain 2 nested datatables - one to show Items. Other to display the details of the item.
<h

ataTable id="Outer Table" value="#{OuterBean.itemList}"
binding="#{OuterBean.table}" var="outerRow">
<h:column>
<h:commandLink actionListener="#{OuterBean.selectRow}">
<h

utputText value="#{outerRow.name}">
</h:commandLink>
<h

ataTable rendered="#{OuterBean.renderMap[outerRow.itemID]}"
value="#{outerRow}">
<h:column>
<h

utputText value="#{outerRow.details}"
</h:column>
</h

ataTable>
</h:column>
<h

ataTable>
-------------------------------------------------------------
You have 2 beans -
OuterBean-
private ArrayList itemList; // list of InnerBean Data
private HtmlDataTable table;
private Map renderMap;
public void selectRow(ActionEvent event) {
// get the row selected.
InnerBean selectedBean = (InnerBean) table.getRowData();
renderMap = new Hashmap();
renderMap.put(selectedBean.getItemID(), true);
}
InnerBean -----------------------
private int itemID;
private
String name;
private String details;
Just add the selected rows Id in the hash map it will work for you...
I hope this will resolve your problem
