[richfaces-issues] [JBoss JIRA] (RF-12647) rich:dataTable rowclick changed scope

Fab Mars (JIRA) jira-events at lists.jboss.org
Fri Dec 7 12:10:17 EST 2012


Fab Mars created RF-12647:
-----------------------------

             Summary: rich:dataTable rowclick changed scope
                 Key: RF-12647
                 URL: https://issues.jboss.org/browse/RF-12647
             Project: RichFaces
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: component-tables
    Affects Versions: 4.3.0.M2
         Environment: Win7, JDK7, Glassfish3, Mojarra 2.1.14, SeamFaces, RF 4.x.x
            Reporter: Fab Mars


During my migration from RF 3.3 I found this:

Before (with RF 3.3.3):
{code:xml}
<rich:dataTable id="shippingList" value="#{billingLister.allShippings}" var="shipping">
  <a4j:support event="onRowClick" reRender="shippingEditForm">
    <a4j:actionparam name="shippingId" value="#{shipping.id}" assignTo="#{shippingEdit.id}"/>
  </a4j:support>

  <rich:column>
	    <f:facet name="header">
	            <h:outputText value="Destination"/>
	    </f:facet>
	    <h:outputText value="#{shipping.destinationCountry.name}" />
  </rich:column>

  <!-- other columns here -->
</rich:dataTable>
{code}

There was nothing really impacting on the migration guide
https://community.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration-ComponentsMigration-RichIterationComponents
So I logically did that with RF4.x.x:

{code:xml}
<rich:dataTable id="shippingList" value="#{billingLister.allShippings}" var="shipping">
  <a4j:support event="rowclick" render="shippingEditForm">
    <a4j:actionparam name="shippingId" value="#{shipping.id}" assignTo="#{shippingEdit.id}"/>
  </a4j:support>

  <rich:column>
    <f:facet name="header">
      <h:outputText value="Destination"/>
    </f:facet>
    <h:outputText value="#{shipping.destinationCountry.name}" />
  </rich:column>

  <!-- other columns here -->
</rich:dataTable>
{code}

But the a4j:aja isn't triggered. To start having something that works, one needs to remove the a4j:param and do it straight.

{code:xml}
<a4j:ajax event="rowclick" render="shippingEditForm" listener="#{shippingEdit.setId(shipping.id)}"/>
{code}

Not sure this is a regression or not, but wait, here's more: when one clicks on a row with that code, he gets an ArrayIndexOutOfBoundsException because the clientID that's actually passed into UIDataAdapter#invokeOnRow is the id of the dataTable itself. Hence  String rowId = clientId.substring(baseId.length() + 1);

So...to make it work, you have to actually declare the <a4j:ajax event="rowclick" /> in the <rich:column/>

Overall that makes quite a difference between RF 3.3 and RF 4.x. I'd say a regression. Or at least that needs an extra clarification in the documentation and migration guide.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list