3 Replies Latest reply on Jun 6, 2008 2:08 AM by Flax Seed

    a4j:commandLink seems to break h:commandLinks in this case

    Flax Seed Newbie

      I'm experiencing an issue where I have a partial page rerender. I use it basically push/pop items off a list the application is maintaining in a <ui:repeat> on the form. That works great!

      However, when I click the save button, which is an <h:commandLink/>, the flow won't process the request and send it to the next page. Then, subsequent clicks result in no action at all.

      I'm still looking into this but wanted to see if anyone else is experiencing this and if there's a reasonable solution. One solution we came up was to convert the <a4j:commandLink/> to an <h:commandLink/> but then you lose the partial page render semantics.

      Thanks Sergey for the secret "process" tag used in conjunction with <a4j:commandLink ajaxSingle="true"> but this doesn't help either.

      Here's my code:

       <a4j:outputPanel id="productsAffectedPanel">
       <table border="0" width="100%">
       <thead>
       <tr>
       <th><h:outputText value="Product Family" /></th>
       <th><h:outputText value="Product" /></th>
       <th style="width: 150px"><h:outputText value="PackageType" /></th>
       <th></th>
       </tr>
       </thead>
       <tbody>
       <ui:repeat value="#{pcnRequest.productsAffectedList}" var="item">
       <tr>
       <td><h:outputText value="#{item.productFamilyName}"></h:outputText>
       </td>
       <td><h:outputText value="#{item.productName}"></h:outputText>
       </td>
       <td><h:outputText value="#{item.packageTypeName}"></h:outputText>
       </td>
       <td><a4j:commandLink action="editProduct" title="Edit row"
       oncomplete="javascript:Richfaces.showModalPanel('editProductAffectedModelPanel','');"
       reRender="editProductAffectedModelPanel">
       <h:graphicImage value="/images/EditIcon.gif"></h:graphicImage>
       <f:param name="productId" value="#{item.id}" />
       </a4j:commandLink> <h:outputText value=" "></h:outputText>
       <h:commandLink action="deleteProduct" title="Remove row">
       <h:graphicImage value="/images/deleteRecordRow.gif"></h:graphicImage>
       <f:param name="productId" value="#{item.id}" />
       </h:commandLink></td>
       </tr>
       </ui:repeat>
       <tr>
       <td><rich:comboBox style="z-index:2;"
       id="productFamilyBySuggestion" defaultLabel="-Select-"
       title="Product families found in Agile"
       suggestionValues="#{productsAffectedUpdateBean.productFamilySuggestions}"
       directInputSuggestions="true"
       value="#{productsAffectedUpdateBean.productFamilySuggestion}">
       </rich:comboBox></td>
       <td><rich:comboBox style="z-index:2;" id="productBySuggestion"
       defaultLabel="-Select-" title="Product types found in Agile"
       suggestionValues="#{productsAffectedUpdateBean.productSuggestions}"
       directInputSuggestions="true"
       value="#{productsAffectedUpdateBean.productSuggestion}">
       </rich:comboBox></td>
       <td><rich:comboBox style="z-index:2;" id="packageBySuggestion"
       defaultLabel="-Select-" title="Package types found in Agile"
       suggestionValues="#{productsAffectedUpdateBean.packageTypeSuggestions}"
       directInputSuggestions="true"
       value="#{productsAffectedUpdateBean.packageTypeSuggestion}">
       </rich:comboBox></td>
       <td><a4j:commandLink action="addRecord" ajaxSingle="true"
      process="packageBySuggestion,productBySuggestion,productFamilyBySuggestion"
       reRender="productsAffectedPanel" title="Add Record">
       <h:graphicImage style="padding-left:1px;"
       value="/images/insertRecordRow.gif"></h:graphicImage>
       </a4j:commandLink></td>
       </tr>
       </tbody>
       </table>
       </a4j:outputPanel>
      


      Add here's my simple submit/save/cancel button code:
      <h:commandLink id="cancel" immediate="true" styleClass="ovalbutton reset_button" action="cancel">
       <span>Cancel</span>
       </h:commandLink><h:commandLink id="submit" styleClass="ovalbutton submit_button" action="submit">
       <span>Submit</span>
       </h:commandLink> <h:commandLink id="save"
       styleClass="ovalbutton save_button" action="save">
       <span>Save as Draft</span>
       </h:commandLink>


      Thanks!