2 Replies Latest reply on Apr 14, 2009 3:26 PM by Lee Snett

    rich:suggestionbox and a4j:support

    Lee Snett Newbie

      I have included some xhtml that includes two h:inputText each with a corresponding rich:suggestionbox performing autocomplete functions. The first h:inputText also incorporates an a4j:support tag.

      The intent is that after the user selects a suggestion in the first inputText the action of the a4j:support (event="onchange") executes and modifies the behavior of the second rich:suggestionBox.

      What happens though is that the action of the a4j:support only sees the partial value of the inputText originally typed by the user and not the full value that is provided by selection from the suggestionbox.

      Note that the a4j:support works fine without the rich:suggestionbox and conversely the rich:suggestionbox works fine without the a4j:support tag.

      How can I get these to work together?

      Thanks for any help.

      (RichFaces 3.3.0, MyFaces 1.2.6, Facelets 1.1.14, Spring WebFlow 2.0.6, Tomcat 6.0.18)

       <ui:composition template="swapEquipmentMaintenanceActivityTemplate.xhtml">
      
       <ui:define name="removedEquipment">
      
       <t:div id="swapRemovedEquipment" >
      
       <a4j:region>
       <h:inputText id="equipmentSwapRemoved" style="margin:0px" value="#{viewScope.removedUnavcoId}" required="true">
       <a4j:support event="onchange" action="setRemovedEquipment" reRender="swapAddedEquipment"/>
       </h:inputText>
       <h:graphicImage value="/images/selectArrow.png"
       onclick="#{rich:component('swapRemoveSuggestion')}.callSuggestion(true)" alt="" />
       </a4j:region>
      
       <rich:suggestionbox height="200" width="300"
       suggestionAction="#{stationMaintenanceActions.getEquipmentRemovalCandidates}"
       var="equipment"
       for="equipmentSwapRemoved"
       fetchValue="#{equipment.idUNAVCO}"
       id="swapRemoveSuggestion" >
      
       <h:column>
       <h:graphicImage value="#{equipment.smallImageUrl}" />
       <br/>
       <h:outputText value="#{resourceBundle[equipment.equipmentType.labelKey]}" />
       </h:column>
       <h:column>
       <h:outputText value="#{equipment.idUNAVCO}"/>
       </h:column>
       <h:column>
       <h:outputText value="#{equipment.serialNumber}"/>
       </h:column>
       </rich:suggestionbox>
      
       </t:div>
       </ui:define>
      
       <ui:define name="addedEquipment">
       <t:div id="swapAddedEquipment" >
       <t:panelGroup >
       <h:inputText id="equipmentSwapAdded" style="margin:0px" value="#{viewScope.unavcoId}" required="true">
       </h:inputText>
       <h:graphicImage value="/images/selectArrow.png"
       onclick="#{rich:component('equipAddSuggestion')}.callSuggestion(true)" alt="" />
       </t:panelGroup>
      
       <rich:suggestionbox height="200" width="300"
       suggestionAction="#{stationMaintenanceActions.getMatchingEquipmentTypeAddCandidates}"
       var="equipment"
       for="equipmentSwapAdded"
       fetchValue="#{equipment.idUNAVCO}"
       id="equipAddSuggestion" >
      
       <h:column>
       <h:graphicImage value="#{equipment.smallImageUrl}" />
       <br/>
       <h:outputText value="#{resourceBundle[equipment.equipmentType.labelKey]}" />
       </h:column>
       <h:column>
       <h:outputText value="#{equipment.idUNAVCO}"/>
       </h:column>
       <h:column>
       <h:outputText value="#{equipment.serialNumber}"/>
       </h:column>
      
       </rich:suggestionbox>
       </t:div>
      
       </ui:define>
      
       </ui:composition>