2 Replies Latest reply on May 12, 2007 4:17 AM by terron

    a4j:support and rich:suggestionbox

    terron

      Hello,

      I have a text field (su1e) with a suggestionbox.
      When the user selects a suggestion, another field (su1ed) should be populated accordindly.
      For that to happen I use a a4j:support reRender="su1ed".

      And this is working in the case the user uses the keyboard to select a suggestion (presses enter). But if he uses the mouse to make the selection (click), the dependent field does not rerender.

      <h:inputText value="#{backBean.name}" id="su1e">
       <a4j:support event="onkeyup" ajaxSingle="true" reRender="su1ed"/>
      </h:inputText>
      <rich:suggestionbox for="su1e" suggestionAction="#{backBean.autocomplete}"
       var="suggest"
       reRender="su1ed"
       width="150" height="200">
       <h:column> <h:outputText value="#{suggest}"/> </h:column>
      </rich:suggestionbox>
      
      <h:inputText value="#{backBean.depa}" id="su1ed"/>
      


      I tried sorrounding with <a4j:region> but that is also not doing it.



        • 1. Re: a4j:support and rich:suggestionbox

          It should not. You misunderstood the concept there. Suggestionbox sends the ajax request when it retrieves the data for suggestion. I.e. before the moment when user sees the list. You want to re-render something after user selects from the list.
          So you need to add < a4j:support event="onselect" reRender="su1ed" /> as a child to suggestionbox itself.

          • 2. Re: a4j:support and rich:suggestionbox
            terron

            now that you said it, sounds logic :) + for the records: I was overkilling the issue after testing many things. So, to make it run I also took out the reRender="su1ed" from the suggestionbox (at the beginning I thought that only should do the job...)
            Thnx!