Hej HockChai Lim,
you could use a dataTable like this:
<h:form id="myForm">
<h:dataTable id="myTable value="#{backingBeanA.items}" var="item">
<h:column>
<f:facet name="header">ItemName</f:facet>
<h:outputText value="#{item.name}">
</h:column>
<h:column>
<h:panelGrid columns="2">
<h:commandButton id="editBtn" action="#{backingBeanB.editItem(item)}" value="edit Item"/>
<h:commandButton id="deleteBtn" action="#{backingBeanA.deleteItem(item)}" value="delete"/>
</h:panelGrid>
</h:column>
</h:dataTable>
</h:form>
in backingBeanB you need the method
// saves the item in item2Edit
// and returns the editPage.xhtml
// there you could get the item from
// backingBeanB with
// #{backingBeanB.item2Edit}
public String editItem(Item item) {
this.item2Edit = item;
return "editPage";
for deleting the item in backingBeanA, also the method
// saves the given item in item2Delete member and
// returns a deletion confirm page
public String deleteItem(Item item) {
this.item2Delete = item;
return "confirmItemDeletion";
or you could use the
<f:setPropertyListener target="#{backingBeanB.item}" value="item"/>
within your dataTable
hope this helps a bit..
Patrick