11 Replies Latest reply on Feb 16, 2010 11:53 AM by Tanya Ruttenberg

    combobox select nothing

    Ahmet Guven Newbie

      I am using rich:combobox.. I do not want any manuel inputs... when I select one value, later I decide to select nothing I can not get rid of the previous value in the list.. I tried

      <f:selectItem itemValue="">
      <f:selectItems value="#{myBean.values}">

      but I got errors... What can I do to select nothing after I select one item in the list (no mauel input). thanks...

        • 1. Re: combobox select nothing
          Ahmet Guven Newbie

          can you please tell me is there another way to do that or do I have to make manual input 'true' to clean input box after once I select an item from the list? thanks..

          • 3. Re: combobox select nothing
            Francois Duquette Newbie

            Sadly, bug RF-8057 has been closed, but without any fix.  This missing feature/bug is so much important to our application, I can't imagine it has been closed without any fix. We really need to be able to select null/empty value from richfaces combo-box...

            • 4. Re: combobox select nothing
              Jay Balunas Master

              Hi Frank,


              I wanted to reply in the forum thread to your comments in the jira.  The forum is typically a better place to bring up the concerns, and points you made in the jira.  This allows for conversations without cluttering jira :-)


              We are discussing this in more detail now, and I appreciate you bringing your concern up.  I'll add it to the agenda for tomorrows meeting.


              Although in some cases closing an issue because it's resolution will break other functionality is valid, in this case I feel this is still a valid feature request.  We'll discuss the complexity of the breakage, and update the jira with either more details as to why it was resolved and won't be fixed, or reopen it as a feature request.


              Either way I can not guarantee this will be resolved in 3.3.3.  As you can see from the comments we wanted to investigate the risk of a fix here and decide based on that because of the stage and nature of a point release.


              BTW - have you tried styling the normal selectOneMenu with "rich-" styles so they look the same as the RichFaces ones?



              • 5. Re: combobox select nothing
                Francois Duquette Newbie

                Hi Jay,


                first, I really appreciate your quick response and understand your first point.  I hope this ticket will be re-opened in jira.


                As a side note, I tried to mimic a "rich:comboBox" with a jsf "h:selectOneMenu", by adding "rich-select" css style, as you said (is this really what you meant?), but without any luck, 'E'xactly as mentionned by someone over at coderanch a year and a half ago:



                My result is the same as his:



                <h:selectOneMenu id="provinceTest" value="#{customerPageForm.provinceSelectBoxValue}" styleClass="rich-select">
                     <f:selectItems value="#{customerPageForm.provinceSelectBoxItems}" />


                I've enabled "org.richfaces.CONTROL_SKINNING" at first, than also enabled "org.richfaces.CONTROL_SKINNING_CLASSES" to try it, in web.xml,

                as stated in RichFaces documentation (section 5.11.8. Standard Controls Skinning, http://docs.jboss.org/richfaces/3.3.2.GA/en/devguide/html/ArchitectureOverview.html)


                Still, nothing happens, plain old&ugly greyed drop down...tried with both IE7(Standards-compliant mode) and Moz. Firefox 3.5.6



                Anyway, at the end, the best would be to enable Rich:ComboBox to select empty/null value, so we could benefit of its other features. In the meanwhile, if I(we) could at least mimic rich:comboBox with a jsf h:selectOneMenu perfectly and as easy as it is supposed to be (by only specifying a richfaces css class), I would be happy, but this is not the case right now....am I missing something ?



                • 6. Re: combobox select nothing
                  Jay Balunas Master

                  FYI - I have reopened the jira RF-8057, and added a comment to it regarding the reason and plan.


                  As for the styling issue you are having we'll look into it and get back to you.

                  • 7. Re: combobox select nothing
                    Tanya Ruttenberg Expert

                    Just to add my voice to this squeaky wheel I have the same issue.


                    See my previous posting on my frustration with "select" options (which you already responded to Jay(?), thanks.)


                    1. comboBox does not allow you to enter a value other than what is displayed (ie display AT&T enter ATT -- can't do it)

                    2. Can't make the selectOneMenu look pretty like comboBox

                    3. Rigged a suggestionBox to do this, but the amount of time it takes to display a 3 item menu makes it impractical


                    I'll probably go with selectOneMenu as I suspect my (in-house) users care more about performance than looks.


                    If anyone else has a suggestion on a workaround for this, please reply.



                    • 8. Re: combobox select nothing
                      Ilya Shaikovsky Master

                      1) you mean enter manually? But it should allow.. any details?


                      2) yes, thats why our controls uses custom markup. browser controls are hard to be skined in many cases.


                      3) sure. that's the reason of comboBox implementation. to provide light client-side suggestion-to-input component.

                      • 9. Re: combobox select nothing
                        Tanya Ruttenberg Expert

                        Sorry I was sketchy.


                        I want to reproduce this in comboBox


                             <h:selectOneMenu value="#{offices.workstationCount}">
                                  <f:selectItem itemLabel="" itemValue="" />
                                  <f:selectItem itemLabel="1-50" itemValue="1" />
                                  <f:selectItem itemLabel="51-100" itemValue="51" />
                                  <f:selectItem itemLabel="101-300" itemValue="101" />
                                  <f:selectItem itemLabel="301-750" itemValue="301" />
                                  <f:selectItem itemLabel="751+" itemValue="751" />


                        Is it possible to have an input value that is different from the display label?


                        I haven't been able to figure it out and I have a dim memory of being told in some long ago previous forum posting that it could not be done.





                        • 10. Re: combobox select nothing
                          Ilya Shaikovsky Master
                          As I written before in 3) point - component designed as just input with client side suggestion. It mainly designed to use suggestionList which pointed to list of strings.. And supports only value attribute in selectItems for declarative page definitions. But in general it also could be custom objects in list if you will defined proper converter.
                          • 11. Re: combobox select nothing
                            Tanya Ruttenberg Expert

                            Hmm, it didn't occur to me to write a converter for the comboBox.  Is that what you are ultimately suggesting? I have no idea how to do this, but I imagine it's not too hard.  That sounds like the best idea so far.


                            I tried a suggestion box, but the way I implemented it was slow.

                            Sorry, I didn't understand completely what you said. I'm still pretty much a neophyte...