3 Replies Latest reply on Mar 5, 2009 3:57 AM by Artaud Terranova

    rich:comboBox - only first one is working

    Artaud Terranova Newbie

      I have form with multiple comboBoxes:

      <td class="centerColumn">
       <rich:comboBox id="cbLabel" defaultLabel="#{msg['quicksearch.make.all']}" value="#{qsearch.label}" enableManualInput="false">
       <a4j:support event="onselect" reRender="cbModelgroup, modelgroupBackButton, labelBackButton, count" ajaxSingle="true" />
       <f:selectItems value="#{qsearch.labels}" />
       </rich:comboBox>
       </td>
      ...
      <td class="centerColumn">
       <rich:comboBox id="cbModelgroup" defaultLabel="#{msg['quicksearch.modelgroup.all']}" value="#{qsearch.modelgroup}" enableManualInput="false">
       <a4j:support event="onselect" reRender="cbModel, modelgroupBackButton, modelBackButton, count" ajaxSingle="true" />
       <f:selectItems value="#{qsearch.modelgroups}" />
       </rich:comboBox>
       </td>
      


      Problem is: when I choose something on first one, current value is updated, but when I choose something on 2nd, it's not.
      Both of them use standar getters/setters + log message on set. Here is log for both:

      15:54:59,484 DEBUG [RendererBase] Start decoding of component j_id47:cbLabel with class org.richfaces.component.html.HtmlComboBox
      15:54:59,484 DEBUG [AjaxPhaseListener] Process after phase APPLY_REQUEST_VALUES 2
      15:54:59,484 DEBUG [RequestLoggingPhaseListener] Entering JSF Phase: PROCESS_VALIDATIONS 3
      15:54:59,484 DEBUG [AjaxPhaseListener] Process before phase PROCESS_VALIDATIONS 3
      15:54:59,484 DEBUG [FlowLifecycle] Processing validators
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' in Spring ApplicationContext
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' via original VariableResolver
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Successfully resolved variable 'qsearch' via original VariableResolver
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' in Spring ApplicationContext
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' via original VariableResolver
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Successfully resolved variable 'qsearch' via original VariableResolver
      15:54:59,484 DEBUG [AjaxPhaseListener] Process after phase PROCESS_VALIDATIONS 3
      15:54:59,484 DEBUG [RequestLoggingPhaseListener] Entering JSF Phase: UPDATE_MODEL_VALUES 4
      15:54:59,484 DEBUG [AjaxPhaseListener] Process before phase UPDATE_MODEL_VALUES 4
      15:54:59,484 DEBUG [FlowLifecycle] Processing model updates
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' in Spring ApplicationContext
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' via original VariableResolver
      15:54:59,484 DEBUG [SpringBeanWebFlowVariableResolver] Successfully resolved variable 'qsearch' via original VariableResolver
      15:54:59,484 DEBUG [QuickSearch] @@@ setting label to: Aston Martin
      15:54:59,500 DEBUG [AjaxPhaseListener] Process after phase UPDATE_MODEL_VALUES 4
      15:54:59,500 DEBUG [RequestLoggingPhaseListener] Entering JSF Phase: INVOKE_APPLICATION 5
      15:54:59,500 DEBUG [AjaxPhaseListener] Process before phase INVOKE_APPLICATION 5
      15:54:59,500 DEBUG [FlowLifecycle] Processing application
      15:54:59,500 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' in Spring ApplicationContext
      15:54:59,500 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' via original VariableResolver
      15:54:59,500 DEBUG [SpringBeanWebFlowVariableResolver] Successfully resolved variable 'qsearch' via original VariableResolver
      15:54:59,500 DEBUG [FlowActionListener] No action event detected
      15:54:59,500 DEBUG [AjaxPhaseListener] Process after phase INVOKE_APPLICATION 5
      15:54:59,500 DEBUG [ViewState] Rendering + [JSFView = '/WEB-INF/flows/main/quicksearch.xhtml']
      
      ...
      
      15:56:29,921 DEBUG [RendererBase] Start decoding of component j_id47:cbModelgroup with class org.richfaces.component.html.HtmlComboBox
      15:56:29,921 DEBUG [AjaxPhaseListener] Process after phase APPLY_REQUEST_VALUES 2
      15:56:29,921 DEBUG [RequestLoggingPhaseListener] Entering JSF Phase: PROCESS_VALIDATIONS 3
      15:56:29,921 DEBUG [AjaxPhaseListener] Process before phase PROCESS_VALIDATIONS 3
      15:56:29,921 DEBUG [FlowLifecycle] Processing validators
      15:56:29,921 DEBUG [AjaxPhaseListener] Process after phase PROCESS_VALIDATIONS 3
      15:56:29,921 DEBUG [RequestLoggingPhaseListener] Entering JSF Phase: UPDATE_MODEL_VALUES 4
      15:56:29,921 DEBUG [AjaxPhaseListener] Process before phase UPDATE_MODEL_VALUES 4
      15:56:29,921 DEBUG [FlowLifecycle] Processing model updates
      15:56:29,921 DEBUG [AjaxPhaseListener] Process after phase UPDATE_MODEL_VALUES 4
      15:56:29,921 DEBUG [RequestLoggingPhaseListener] Entering JSF Phase: INVOKE_APPLICATION 5
      15:56:29,921 DEBUG [AjaxPhaseListener] Process before phase INVOKE_APPLICATION 5
      15:56:29,921 DEBUG [FlowLifecycle] Processing application
      15:56:29,921 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' in Spring ApplicationContext
      15:56:29,921 DEBUG [SpringBeanWebFlowVariableResolver] Attempting to resolve variable 'qsearch' via original VariableResolver
      15:56:29,921 DEBUG [SpringBeanWebFlowVariableResolver] Successfully resolved variable 'qsearch' via original VariableResolver
      15:56:29,921 DEBUG [FlowActionListener] No action event detected
      15:56:29,921 DEBUG [AjaxPhaseListener] Process after phase INVOKE_APPLICATION 5
      15:56:29,921 DEBUG [ViewState] Rendering + [JSFView = '/WEB-INF/flows/main/quicksearch.xhtml']
      


      I spent some time on it, but can't find any mistake. I got almost same form working on other page, I've compared them and still can't figure it out. Maybe you could tell me if I'm missing somehting.

        • 1. Re: rich:comboBox - only first one is working
          Kerdudou Ronan Apprentice

          give more of the jsf page... full page for exemple...

          • 2. Re: rich:comboBox - only first one is working
            Artaud Terranova Newbie

            Here it is, I cleaned it up a bit for easier debugging:

            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich"
             template="/templates/background.xhtml">
            
             <ui:define name="pageTitle">#{msg['quicksearch.title']}</ui:define>
            
             <ui:define name="pageHeader">
             <link rel="stylesheet" type="text/css"
             href="/theme/quicksearch.css"></link>
             <script src="/js/peel.js" type="text/javascript"></script>
             </ui:define>
            
             <ui:define name="pageBody">
             <f:loadBundle basename="input" var="inmsg" />
             <rich:spacer height="10px" />
             <center>
            
             <table width="100%">
             <tr>
             <h:form>
             <td>
             <center><rich:panel style="width: 700px;">
             <f:facet name="header">
             #{msg['quicksearch.paneltitle']}
             </f:facet>
             <table>
             <tr>
             <td><h:outputLabel value="#{msg['quicksearch.make']}" /></td>
             <td class="space" />
             <td class="centerColumn">
             <rich:comboBox id="biSelectLabel" defaultLabel="#{msg['quicksearch.make.all']}" value="#{inputdata.label}" enableManualInput="true" >
             <a4j:support event="onselect" reRender="biSelectModelGroup, biSelectModel" ajaxSingle="true" />
             <f:selectItems value="#{inputdata.labels}" />
             </rich:comboBox>
             </td>
             </tr>
            
             <tr class="break">
             </tr>
             <tr>
             <td class="line" colspan="4"></td>
             </tr>
             <tr class="break">
             </tr>
            
             <tr>
             <td><h:outputLabel value="#{msg['quicksearch.modelgroup']}" /></td>
             <td class="space" />
             <td class="centerColumn">
             <rich:comboBox id="biSelectModelGroup" defaultLabel="#{msg['quicksearch.modelgroup.all']}" value="#{inputdata.modelgroup}" enableManualInput="true" >
             <a4j:support event="onselect" reRender="biSelectModel" ajaxSingle="true" />
             <f:selectItems value="#{inputdata.modelgroups}" />
             </rich:comboBox>
             </td>
             </tr>
            
             <tr class="break">
             </tr>
             <tr>
             <td class="line" colspan="4"></td>
             </tr>
             <tr class="break">
             </tr>
            
             <tr>
             <td><h:outputLabel value="#{msg['quicksearch.model']}" /></td>
             <td class="space" />
             <td class="centerColumn">
             <rich:comboBox id="biSelectModel" defaultLabel="#{msg['quicksearch.model.all']}" value="#{inputdata.carmodel}" enableManualInput="true">
             <f:selectItems value="#{inputdata.carmodels}" />
             </rich:comboBox>
             </td>
             </tr>
             </table>
             </rich:panel>
             </center>
             </td>
             </h:form>
             </tr>
             </table>
            
             </center>
            
             </ui:define>
            </ui:composition>
            
            
            


            • 3. Re: rich:comboBox - only first one is working
              Artaud Terranova Newbie

              I found by accident that it starts to work after first refresh. Anyone know what could be the problem?

              I'm using rich faces 3.3.0 and webflow 2.0.6.CI-31