5 Replies Latest reply on Aug 19, 2009 4:40 AM by mongkeh

    rich:combobox onchange event never called

      Hello,


      I have a rich:combobox with an associated onchange event callback. It works fine if I write into the input, but if I select one item from the suggestion list, the onchange event is never called.



      <rich:comboBox id="institution"
           value="#{bean.institution}"
           suggestionValues="#{institutionConverter.findAll()}"
           immediate="true">
           <a:support event="onchange" reRender="institutionContactField" BypassUpdates="false" ajaxSingle="true"/>
      </rich:comboBox>>
      




      Could any one help me?


      Regards,
      Chiara

        • 1. Re: rich:combobox onchange event never called

          I just have seen that this is a bug in version 3.3.2.CR1


          https://jira.jboss.org/jira/browse/RF-7286


          But i'm using version  3.3.0.GA and it dosen't work.


          Coul any one make it work in richfaces 3.3.0.GA¿?


          Regards,
          Chiara

          • 2. Re: rich:combobox onchange event never called
            kragoth

            Just out of curiosity, what makes you so sure the event is not firing?


            Can you maybe tell us what's supposed to happen? What are you trying to do?


            Maybe give us a bit more of the xhtml. What type of form are you in, etc.

            • 3. Re: rich:combobox onchange event never called

              I test this with firefox firebug plugin.(http://www.getfirebug.com/), it has a console wich shows every ajax call.


              Event fired steps:



              1. focus on the combobox

              2. type the value

              3. lost focus on the combobox

              4. EVENT IS FIRED OK



              Event NO fired steps:



              1. focus on the combobox

              2. type first letters of the value

              3. elect the value from the suggestion list

              4. lost focus on the combobox

              5. EVENT IS NOT FIRED



              I need two nested combobox, when I select the value of the first combobox, the second is fill with the velues depending on the firs selection:


              Here are two nested combobox:



              <h:form id="formId">
              
              <s:decorate id="institutionField" template="layout/edit.xhtml">
                  <ui:define name="label">Institution:</ui:define>
                  <rich:comboBox
                       value="#{bean.institution}"
                       suggestionValues="#{institutionConverter.findAll()}"  
                       immediate="true">         
                       <a:support event="onchange" reRender="contactinstitutionField" bypassUpdates="false" ajaxSingle="true"/>
                  </rich:comboBox>
              </s:decorate>
              
              <s:decorate id="contactinstitutionField" template="layout/edit.xhtml">
                  <ui:define name="label">Sender:</ui:define>
                  <rich:comboBox  
                       value="#{copiaNotaSalienteHome.instance.destinatario}"
                       suggestionValues="#{contactinstitutionConverter.findAll(bean.institution)}"  
                       immediate="true"/>
                  <a:support event="onblur" reRender="contactinstitutionField" bypassUpdates="true" ajaxSingle="true"/>
              </s:decorate>
              
              </h:form>




              regards,

              • 4. Re: rich:combobox onchange event never called

                I test this with firefox firebug plugin.(http://www.getfirebug.com/), it has a console wich shows every ajax call.


                Event fired steps:



                1. focus on the combobox

                2. type the value

                3. lost focus on the combobox

                4. EVENT IS FIRED OK



                Event NO fired steps:



                1. focus on the combobox

                2. type first letters of the value

                3. elect the value from the suggestion list

                4. lost focus on the combobox

                5. EVENT IS NOT FIRED



                I need two nested combobox, when I select the value of the first combobox, the second is fill with the velues depending on the firs selection:


                Here is the xhtml:



                <h:form id="formId">
                
                <s:decorate id="institutionField" template="layout/edit.xhtml">
                    <ui:define name="label">Institution:</ui:define>
                    <rich:comboBox
                         value="#{bean.institution}"
                         suggestionValues="#{institutionBean.findAll()}"  
                         immediate="true">         
                         <a:support event="onchange" reRender="contactinstitutionField" bypassUpdates="false" ajaxSingle="true"/>
                    </rich:comboBox>
                </s:decorate>
                
                <s:decorate id="contactinstitutionField" template="layout/edit.xhtml">
                    <ui:define name="label">Sender:</ui:define>
                    <rich:comboBox  
                         value="#{bean.sender}"
                         suggestionValues="#{contactinstitutionBean.findAll(bean.institution)}"  
                         immediate="true"/>
                </s:decorate>
                
                </h:form>




                regards,
                Chiara

                • 5. Re: rich:combobox onchange event never called

                  Hello Chiara,


                  Can you give us source code of institutionConverter class?