1 Reply Latest reply on Jan 30, 2009 10:42 AM by Justin G

    ExtendedDataModel and commandLink Problem

    Justin G Newbie

      So I originally had a dataTable that contained a commandLink in a row which would fire an action and reRender the table:

      <rich:dataTable value="#{bean.values}" var="curVal" id="mytable">
       ...
       <rich:column>
       <a4j:commandLink value="Link" action="#{bean.changeMenu}" reRender="mytable"/>
       </rich:column>
       ...
       <f:facet name="footer">
       <h:selectOneMenu value="#{bean.menuValue}">
       <f:selectItems value="#{bean.menuOptions}"/>
       </h:selectOneMenu>
       ...
       </f:facet>
      </rich:dataTable>
      

      The changeMenu() code regenerates the menu options for the selectOneMenu and resets the menuValue to the first option. Clicking the command link works (and everything is reRendered), but the selectOneMenu still shows the old value (even though menuValue is updated). I added ajaxSingle="true" to the commandLink and the menu reRendered correctly.

      If the dataTable uses the ExtendedDataModel, ajaxSingle="true" prevents the action for the commandLink from firing at all. Not sure why, but I'm thinking it may be related to: http://jboss.com/index.html?module=bb&op=viewtopic&t=142624.

      Couple questions:
      1) Why does ajaxSingle="true" prevent the commandLink action from being fired when using an EDM?
      2) EDM or no EDM, why does ajaxSingle="false" cause the menu in the footer to display the old selected value after reRender?

      Thanks