0 Replies Latest reply on Feb 17, 2008 8:25 PM by Ariel Fernando

    suggestionbox - a4j:include - a4j:support

    Ariel Fernando Newbie

      Hi all,

      I'm having some problems to use a suggestionbox component with a4j:support, when I put it into a4j:include file.

      I have like something:

      <h:inputText id="idInputText"
       value="#{backingBean.person.name}"/>
      
      <rich:suggestionbox for="idNumeroDespacho" tokens=",["
       suggestionAction="#{element.autocomplete}"
       var="result"
       fetchValue="#{result.name}"
       first="0"
       rowNumber="10"
       minChars="1"
       border="1"
       width="170"
       height="150"
       nothingLabel="Not Found"
       selfRendered="true">
       <h:column>
       <h:outputText value="#{result.name}" />
       </h:column>
       <a4j:support event="onselect" reRender="idForm">
       <f:setPropertyActionListener value="#{result}"
       target="#{backingBean.person}" />
       </a4j:support>
      </rich:suggestionbox>
      


      Now, if I put above code into main file (that is, not using a4j:include), all works fine. But if I put the same code into a file and include it with <a4j:include viewId...>, I get an error when "onselect" happend.

      I debug this situation and found that happend because when "onselect event" ocurrs, suggestionAction is call again. Yes... suggestionAction is called when I select an option from suggestionbox. But it's only ocurrs if use suggestionbox into incude file.

      To solve it, I must set selfRendered="false" at suggestionbox component. When I set this attribute to false, suggestionAction is not called when onselect event happend. This is a normal behavior.

      Is this a issue?. Is there any restriction to use suggestionbox with a4j:support into a4j:include file?.

      What exactly do the selfRendered="true" into suggestionbox?. I allways set it to true because a read that I get a better performance... but I don't know why.

      Thanks!!!.

      FYI: my enviroment is:
      RichFaces 3.1.4, JSF-1.2