2 Replies Latest reply on Jul 16, 2007 4:18 AM by Richard Hardy

    a4j:support problem in rich:columnGroup

    Richard Hardy Newbie

      Hi,
      I am not sure if this belongs in the a4j forum or here. Please excuse me if I have the wrong place.

      I am trying to create a rich:dataTable where clicking on a particular row within the table causes an ajax actionListener to be called.

      My original attempt was something like:

      <rich:dataTable id="folderMessagesListDataTable"
       value="#{folderMessageListBacker.docList.DMeldungDataModel}"
       var="oneTextDoc">
       <rich:columnGroup styleClass="#{oneTextDoc.listTextColourStyleClass}">
       <a4j:support immediate="true"
       event="onclick"
       reRender="ajaxRenderedTabPanel"
       actionListener="#{folderMessageListBacker.processViewTextDocClicked}"
       eventsQueue="generalEventQueue"
       oncomplete="releaseAjax();"/>
       <rich:column>
       <h:outputText value="#{oneTextDoc.owner}"
       id="ownerField"/>
       </a4j:commandLink>
       </rich:column>
       <rich:column>
       <h:outputText value="#{oneTextDoc.title}"/>
       <rich:spacer rendered='#{empty oneTextDoc.title}'/>
       </rich:column>
       </rich:columnGroup>
      </rich:dataTable>



      However, although this fires an ajax event to the server, my action listener was never called.

      If, however, I move the a4j:support tagto be inside the column rather than the column group, everything works as expected:


      <rich:dataTable id="folderMessagesListDataTable"
       value="#{folderMessageListBacker.docList.DMeldungDataModel}"
       var="oneTextDoc">
       <rich:columnGroup styleClass="#{oneTextDoc.listTextColourStyleClass}">
      
       <rich:column>
       <a4j:support immediate="true"
       event="onclick"
       reRender="ajaxRenderedTabPanel"
       actionListener="#{folderMessageListBacker.processViewTextDocClicked}"
       eventsQueue="generalEventQueue"
       oncomplete="releaseAjax();"/>
       <h:outputText value="#{oneTextDoc.owner}"
       id="ownerField"/>
       </rich:column>
       <rich:column>
       <h:outputText value="#{oneTextDoc.title}"/>
       <rich:spacer rendered='#{empty oneTextDoc.title}'/>
       </rich:column>
       </rich:columnGroup>
      </rich:dataTable>


      My problem is that I have lots of columns and would really like to reduce the amount of "onclick" code that is being generated, so that there is one "onclick" event for the generated element rather than one each for all elements.

      Is this a bug or a feature?

      Thanks,
      Richard Hardy.

        • 1. Re: a4j:support problem in rich:columnGroup
          Ilya Shaikovsky Master

          It isn't nessesary to use support for every column.

          You may just make as in code snippet 1 but use onRowClick event.

          • 2. Re: a4j:support problem in rich:columnGroup
            Richard Hardy Newbie

            OK, I have now tried the following:

            <rich:columnGroup styleClass="#{oneTextDoc.listTextColourStyleClass}">
             <a4j:support immediate = "true"
             event="onRowClick"
             reRender="ajaxRenderedTabPanel"
             actionListener="#{folderMessageListBacker.processViewTextDocClicked}"
             eventsQueue="generalEventQueue"
             oncomplete="releaseAjax();">
             <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>
             <a4j:actionparam name="clusterID"
             assignTo="#{folderMessageListBacker.selectedClusterId}"
             value="#{oneTextDoc.DMeldung.CID}"/>
             </a4j:support>
             <rich:column>
             <h:outputText value="#{oneTextDoc.owner}"
             id="ownerField"/>
             </rich:column>
             <rich:column>
             <h:outputText value="#{oneTextDoc.keyword}"/>
             <rich:spacer rendered='#{empty oneTextDoc.keyword}'/>
             </rich:column>


            but this does nothing when I run click on the column. I am using IE 6.

            Any further help would be appreciated.

            Thanks,
            Richard.