4 Replies Latest reply on Sep 8, 2008 10:18 AM by vincent.crepin

    rich:combobox problems

    vincent.crepin

      Hello.

      I have many problems using combobox in my applications. The control is functionnaly very cool and it is exactly what I need. But it behaves strangely.

      The strangest thing is that the problems are not consistent.

      1) sometimes, when I post back my form, the value of certain comboboxes are resetted. It is not always the same that behaves like that.

      2) when I first load my page, the suggestion list is not always shown correctly. Sometimes, incomplete, sometimes totally absent, etc.

      I use richfaces 3.2.1.GA.

      I'm using comboboxes in a datalist.

      <rich:dataList var="ingredient" value="#{org_domain_recipes_session_uievents_ingredientList}"
       rows="10" id="ingredientDataList">
       <table cellspacing="0" cellpadding="0" border="0">
       <tr>
       <td><rich:comboBox selectFirstOnUpdate="false"
       suggestionValues="#{org_domain_recipes_session_uievents_recipeEdit.allQuantities}"
       defaultLabel="#{messages['recipeEdit.noSelection.label']}"
       value="#{ingredient.quantity}" listHeight="500">
       </rich:comboBox></td>
       <td><rich:comboBox selectFirstOnUpdate="false"
       suggestionValues="#{org_domain_recipes_session_uievents_recipeEdit.allIngredientQuantities}"
       defaultLabel="#{messages['recipeEdit.noSelection.label']}"
       value="#{ingredient.quantityType}" listHeight="500">
       </rich:comboBox></td>
       <td><rich:comboBox selectFirstOnUpdate="false"
       suggestionValues="#{org_domain_recipes_session_uievents_recipeEdit.allIngredientDescriptions}"
       defaultLabel="#{messages['recipeEdit.noSelection.label']}"
       value="#{ingredient.description}" listHeight="500"
       width="200">
       </rich:comboBox></td>
       <td><a4j:commandButton
       action="#{org_domain_recipes_session_uievents_recipeEdit.removeIngredient(ingredient)}"
       value="#{messages['recipeEdit.removeIngredientButton.label']}"
       reRender="ingredientsPanel" ajaxSingle="false"></a4j:commandButton>
      
       </td>
       </tr>
       </table>
      </rich:dataList>
      


      The suggestions are simply Lists of String objects.

      Have someone succeeded to make this kind of code work correctly ?

      Thanks in advance.

        • 1. Re: rich:combobox problems
          vincent.crepin

          The partially shown problem was due to the fact that some items in the List of Strings were empty.

          Now I can't figure out why some values are resetted when posting data. It seems that they are resetted prior to posting (or in the update process) because server side, the values are not available.

          • 2. Re: rich:combobox problems
            ilya_shaikovsky

            place rich:messages to the page please.

            • 3. Re: rich:combobox problems
              vincent.crepin

              Yes there is already one. Nothing is shown in it. You suspected a validation error ?

              V.

              • 4. Re: rich:combobox problems
                vincent.crepin

                Here it is if you want to see it.

                <a4j:outputPanel id="messagesPanel" ajaxRendered="true" >
                 <rich:messages passedLabel="No error" layout="list" globalOnly="true"
                 infoLabelClass="infoLabelClass" infoClass="infoClass"
                 fatalClass="fatalClass" fatalLabelClass="fatalLabelClass"
                 warnClass="warnClass" warnLabelClass="warnLabelClass"
                 errorLabelClass="errorLabelClass" errorClass="errorClass" styleClass="messagesClass">
                 <f:facet name="header">
                 <h:outputText value="Messages:"></h:outputText>
                 </f:facet>
                 <f:facet name="errorMarker">
                 <h:graphicImage value="/img/attention.gif" />
                 </f:facet>
                 <f:facet name="infoMarker">
                 <h:graphicImage url="/img/green.gif" />
                 </f:facet>
                 <f:facet name="warnMarker">
                 <h:graphicImage url="/img/warning.gif" />
                 </f:facet>
                 <f:facet name="fatalMarker">
                 <h:graphicImage url="/img/error.gif" />
                 </f:facet>
                 </rich:messages>
                 </a4j:outputPanel>