9 Replies Latest reply on May 25, 2015 3:55 AM by michpetrov

    How to Stop Filtering in <rich:select>

    sumitghosh945

      I'm using <rich:select> in my project.My Requirements are:

      1) <rich:select> will show the all item as a drop-down.

      2)User will be able to give manual input,I have done this by setting enableManualInput="true".

       

      But,while setting enableManualInput="true",It not showing all elements in the list after a particular selection.Perhaps it is enabling its filtering function that's why showing only the selected item in the list and hiding  rest of the items.I want to stop this,this can be achieved very easily if I do enableManualInput="false",but this will disable manualinput faciolity so,I cannot use it,as my project require to provide manual input facilty to the user.

       

      So,can anyone give me a solution that will show all the elements in the dropdown even after  selection of a particular item and also allow the user to provide manualInput.

      I'm attaching the screenshot of my page herewith.

        • 1. Re: How to Stop Filtering in <rich:select>
          michpetrov

          You can disable filtering by setting a clientFilterFunction for <rich:select>

           

          <rich:select clientFilterFunction="noFilter">
               <f:selectItems … />
          </rich:select>
          
          noFilter = function() {
               return true;
          }
          

          This will show every item, but it won't highlight the item matching the text which I assume is what you want to do.

           

          EDIT: the filter should be returning boolean

          • 2. Re: How to Stop Filtering in <rich:select>
            sumitghosh945

            no its not doing,it causing the same problem as I have explained in the question,I have tried your sample,but not woking

            • 3. Re: How to Stop Filtering in <rich:select>
              michpetrov

              Are you getting any errors in the console?

              • 4. Re: How to Stop Filtering in <rich:select>
                sumitghosh945

                no error but it is not serving the purpose I had mention in the question that after selection of an item from the list if user again click the dropdown it should show all the elements present  in list.But your code not showing all the element after I select one Specific Element,it is  showing only the selected item.If my word are not clear to you,please refer to the screenshot attached in the question,You will perhaps understand.

                • 5. Re: How to Stop Filtering in <rich:select>
                  michpetrov

                  Ok, I think I understand. You select a value from the list and when you click the input box again you want to see all the elements. That's not possible if you want the manual input to work as well. Manual input will filter the elements, that's the reason for using it.

                   

                  But perhaps there is a workaround, why do you need to see all the values? I assume you want to change the value that is currently selected. But if the user is going to change the value manually he must delete the current value anyway. And when he does he will see the whole list again.

                  • 6. Re: How to Stop Filtering in <rich:select>
                    vijimv

                    helloo,

                     

                    I am also having the same requirement as SUMIT said. The user needs the filter functionality as well as the whole list while clicking on the dropdown button,

                     

                    Is there any other component in richfaces that can we use for this purpose? or can we customize <rich:select> in such way that the above requirement is satisfied?

                     

                    Can anyone suggest any solution......

                     

                    Thanks

                    • 7. Re: How to Stop Filtering in <rich:select>
                      michpetrov

                      Forcing the list to show is probably the only option - you can put an event listener on the button and call __showPopup() on the select, that should work.

                      • 8. Re: How to Stop Filtering in <rich:select>
                        vijimv

                        hi ,

                         

                        i tried to add an event listner on the button but failed. I have a doubt -  actually the button is added as a style , then how can we add event listner to that button?

                         

                        i'm new to richfaces, please excuse me if I asked anything wrong .

                         

                        Thanks

                        • 9. Re: How to Stop Filtering in <rich:select>
                          michpetrov

                          The button is an HTML element like any other, in this case a span with class="rf-sel-btn", simply select it with jQuery.