a4j:support problem in rich:columnGroup
rhardy5014 Jul 12, 2007 8:39 AMHi,
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.