6 Replies Latest reply on Aug 19, 2009 4:25 AM by ilya_shaikovsky

    rich:Combobx ajax support issue!

    kidrock_hj

      My intenstion is when I change the first combobox, there is three choice, when I select the second some of the other component is show, then I select some other choice, the componenet will be hide.

      My UI Code

      <h:form id="quickSearchForm">
       <h:panelGrid id="quickSearchPanel" columns="9" cellpadding="1" cellspacing="0">
       <h:outputText value="Quick Search:" styleClass="gridhello" />
       <rich:comboBox width="140px" suggestionValues="#{comboboxBean.quickSelectList}"
       valueChangeListener="#{comboboxBean.selectionChanged}" enableManualInput="false" >
       <a4j:support event="onlistclose" reRender="quickSearchPanel" ajaxSingle="true"/>
       </rich:comboBox>
       <h:outputText value="Mfg Code:" rendered="#{comboboxBean.selectMan}" />
       <rich:comboBox width="120px" rendered="#{comboboxBean.selectMan}" >
       </rich:comboBox>
       <h:outputText value="Part#:" rendered="#{comboboxBean.selectMan}" />
       <h:outputText value="Cust Num:" rendered="#{comboboxBean.selectCus}" />
       <rich:comboBox width="100px" rendered="#{comboboxBean.selectCus}" >
       </rich:comboBox>
       <h:inputText value="" size="10" styleClass="id_input" />
       <h:commandButton value="Go" immediate="true" />
       </h:panelGrid>
       </h:form>
      


      My backing bean
      package com.avnet.quest.jsf.quicksearch;
      
      import java.util.ArrayList;
      import java.util.List;
      
      import javax.faces.event.ValueChangeEvent;
      
      public class QuickSearchComboboxBean {
      
       private boolean selectMan = false;
       private boolean selectCus = false;
       private int i = 0;
      
       private List<String> quickSelectList;
      
       public QuickSearchComboboxBean(){
       quickSelectList = new ArrayList<String>();
       quickSelectList.add("Quote #");
       quickSelectList.add("Manufacture Part #");
       quickSelectList.add("Customer Account #");
       }
      
       public void selectionChanged(ValueChangeEvent event){
       System.out.println(event.getNewValue());
      
       if("Manufacture Part #".equals(event.getNewValue())){
       selectMan = true;
       }else{
       selectMan = false;
       }
      
       if("Customer Account #".equals(event.getNewValue())){
       selectCus = true;
       }else{
       selectCus = false;
       }
      
       }
      
       public List<String> getQuickSelectList() {
       return quickSelectList;
       }
      
       public void setQuickSelectList(List<String> quickSelectList) {
       this.quickSelectList = quickSelectList;
       }
      
       public boolean isSelectMan() {
       return selectMan;
       }
      
       public void setSelectMan(boolean selectMan) {
       this.selectMan = selectMan;
       }
      
       public boolean isSelectCus() {
       return selectCus;
       }
      
       public void setSelectCus(boolean selectCus) {
       this.selectCus = selectCus;
       }
      
      
      }
      


      Above code is working on firefox 3.0.12, but not IE 7.
      The onlistclose will not trigger the ajax call for IE 7.

      Is this a bug in 3.3.1 GA?

        • 1. Re: rich:Combobx ajax support issue!
          kidrock_hj

          Let me make my question more clear.

          The onchange event will only triggered when the input value changed by the keyboard, it will not triggered after select different value in the select List.

          So I choose to use onlistclose event, but it not works in IE7, works well in firefox.

          Actually the ajax support tag are not working very well for many events on IE7.

          Is there a work around?

          • 2. Re: rich:Combobx ajax support issue!
            ilya_shaikovsky

            verify please if just simple alert instead of support will behave the same.

            • 3. Re: rich:Combobx ajax support issue!
              kidrock_hj

              Don't know wether this is the right way to verify

              IE7:
              The below code run in IE7, the alert('Hello') is exectued twice.
              No ajax call to backend. Still failed if removed onlistclose="alert('Hello');"

              Firefox:
              Alert once, no ajax call to backend, either. But after removed onlistclose="alert('Hello');", it works.

              <rich:comboBox width="140px" value="#{comboboxBean.defaultValue}" suggestionValues="#{comboboxBean.quickSelectList}"
               valueChangeListener="#{comboboxBean.selectionChanged}" selectFirstOnUpdate="true" onlistclose="alert('Hello');" >
               <a4j:support event="onlistclose" reRender="quickSearchPanel" ajaxSingle="true"
               ignoreDupResponses="true" />
               </rich:comboBox>



              Any idea???!!

              • 4. Re: rich:Combobx ajax support issue!
                ilya_shaikovsky

                comboBox bean should be session scoped or should be marked with keep alive for ajax requests.

                • 5. Re: rich:Combobx ajax support issue!
                  kidrock_hj

                  It is session scope. It still doesn't work.

                  <managed-bean>
                   <managed-bean-name>comboboxBean</managed-bean-name>
                   <managed-bean-class>com.avnet.quest.jsf.quicksearch.QuickSearchComboboxBean</managed-bean-class>
                   <managed-bean-scope>session</managed-bean-scope>
                   </managed-bean>


                  • 6. Re: rich:Combobx ajax support issue!
                    ilya_shaikovsky

                    just copy/pasted your code and checked under IE8(both 8 and 7 modes) works just as it should. checked under RF 3.3.2 snapshot. Sorry but could you please check under snapshot also? seems even if the issue was present it's fixed now.