1 Reply Latest reply on Sep 4, 2008 2:49 AM by betul aydin

    rich:datatable, a4j:support and onRowClick

    Tony Gedge Newbie

      I'm attempting to do a simple list and detail display model with the richfaces data table.

      From what I can tell, I should use a <a4j:support.../> tag within the <rich:dataTable .../> tag to trigger the selection on the onRowClick event.

      However, my action handler never gets called, and I can't work out why.

      I have a page of the following form:

      <a4j:form id="contactForm" ajaxSubmit="true">
       <a4j:support event="onRowClick" action="#{contact.selectRow}" reRender="selectedOtherPartyFragment"/>
       <rich:column sortable="false">
       <f:facet name="header">
       <h:outputText value="#{row}" />
       <rich:column sortBy="#{party.title}">
       <f:facet name="header">
       <h:outputText value="#{party.title}" />
       <rich:column sortBy="#{party.name}">
       <f:facet name="header">
       <h:outputText value="#{party.name}" />
       <a4j:outputPanel id="selectedOtherPartyFragment">
       <f:subview id="detail" rendered="#{contact.selectedParty != null}">
       <rich:spacer height="10px"/>
       <h:outputText value="#{party.title}" />
       <h:outputText value="#{party.name}" />

      and my backing bean (contact) is of this form:
      package com.workcover.clw.noc.web.managedBean;
      import java.io.Serializable;
      import java.util.ArrayList;
      import java.util.List;
      import org.richfaces.component.html.HtmlDataTable;
      import com.workcover.clw.noc.domain.InterestedPartyDetails;
      public class ContactTab implements Serializable {
       /** Version ID */
       private static final long serialVersionUID = 4260048709217435243L;
       private List<InterestedPartyDetails> interestedParties;
       private InterestedPartyDetails selectedRow;
       private transient HtmlDataTable interestedPartiesTable;
       public ContactTab() {
       ... set up some test InterestedPartyDetails objects in interestedParties ...
       public List<InterestedPartyDetails> getInterestedParties() {
       return interestedParties;
       public HtmlDataTable getInterestedPartiesTable() {
       return interestedPartiesTable;
       public void setInterestedPartiesTable(HtmlDataTable interestedPartiesTable) {
       this.interestedPartiesTable = interestedPartiesTable;
       public String selectRow() {
       Object obj = getInterestedPartiesTable().getRowData();
       selectedRow = (InterestedPartyDetails) obj;
       return null;
       public InterestedPartyDetails getSelectedParty() {
       return selectedRow;

      Does anyone have some ideas as to what I am doing wrong? I can't imagine that such a simple interaction can be difficult, but I'm stumped.