1 Reply Latest reply on Jan 18, 2012 2:00 PM by lobo369

    Suggestion Box unexpected error

    lobo369 Newbie

      Hi.

       

      I'm using RichFaces 3.3.2 SR1 with Faceletes and JSF 1.2 RI .  and IE7

       

      When I type a word into de suggestion box the list displayed without problems. But when I click to select one item list some times ocurr a JS error, others just don't happens any and other select the item and update the h:inputText. I need that always the selected item populate the inputtext.

       

       

       

       

      <ui:composition>
        <h:inputText value="#{obj.value}" rendered="#{obj.dto.tipoCampo==1 || obj.dto.tipoCampo==3}" 
            id="INP_FILTRO">
         <a4j:support  event="onchange" ajaxSingle="true" reRender="tablaFiltro"/>
        </h:inputText>
        <rich:suggestionbox rendered="#{obj.dto.tipoCampo==3}"
             fetchValue="#{val.description}"
             for="INP_FILTRO"       
             ajaxSingle="true"
             minChars="3"
             suggestionAction="#{obj.autocomplete}"
             var="val"
             nothingLabel="Sin resultados">
             <a4j:support  event="onselect" reRender="tablaFiltro"/>
             <h:column>
              <h:outputText value="#{val.value}" />
             </h:column>      
             <h:column>
              <h:outputText value="#{val.description}" />
             </h:column> 
        </rich:suggestionbox>  
        
        <h:selectOneMenu value="#{obj.value}" rendered="#{obj.dto.tipoCampo==2}" id="SOM_FILTRO_#{obj.dto.parametro}" >
         <f:selectItems value="#{obj.catalog}"/>
         <a4j:support  event="onchange" ajaxSingle="true" reRender="tablaFiltro"/>  
        </h:selectOneMenu>
        <h:selectManyCheckbox value="#{obj.values}" rendered="#{obj.dto.tipoCampo==4}" 
               layout="pageDirection"
               valueChangeListener="#{obj.processValueChange}">
         <f:selectItems value="#{obj.catalog}"/>   
         <a4j:support  event="onclick" ajaxSingle="true" />   
        </h:selectManyCheckbox>  
       </ui:composition>
      
      

       

      If I select the items with arrow keys I don't have problem.

       

      In a4j:log don't appear anything. (with WARN level)

       

      I don't use any own JS.

        • 1. Re: Suggestion Box unexpected error
          lobo369 Newbie

          Finally I can get the problem.

           

          The problem is a conflict with <a4j:support  event="onchange" ajaxSingle="true" /> . in InputText component.

           

          The event "onchange" was fired when the user click outside the input field (when click on the suggestion list).

           

          I only disabled the onchange event and all be fine. Well the problem is that now I need to send all the components and not only the inputtext.