3 Replies Latest reply on Sep 5, 2011 2:17 PM by Ilya Shaikovsky

    Method filter combo box datas

    jac ba Newbie

      hello there !

      Here is my question : I have a panel with 3 combo boxes. Each one has corresponding datas.

      The panel has a search button which filter the user choice. I write the method to filter information according to the combo box selected.

       

      Could someone helps regards the filter method ?

       

       

      PS: method carry String or Map<String,Object>

       

      Thanks

        • 1. Re: Method filter combo box datas
          Mark Paluch Master

          Hi,

          when i understood you right, you have 3 comboboxes. When you pick a value in the forst box it has an effect on the other two, that the list entries of combobox 2 and 3 are changed (more/less or even different entries).

           

          I would suggest to ajaxify that. So when you pick a combobox value an ajax listener is notified, which does some data handling and prepares data for the comboboxes. With this request you would do also an re-render of the other two comboboxes and you get your data displayed.

           

          Tell me, whether this soulution would be a correct approach to your requirement.

           

          Best regards,

          Mark

          1 of 1 people found this helpful
          • 2. Re: Method filter combo box datas
            jac ba Newbie

            Lets say I get 2 combo boxes with datas and a search button ( type submit)  . Country combo box and city.

            Each one has datas corresponding example : France as country and Marseille as a city. If  you click on search it will filter information regards France and Marseille. But on the other hand, if the user does not specify the city choice ( lets say city : empty ) the search button will filter only for the country ( France ). Grosso Modo, All france cities  without no cities specifications.

            Best regards and Thanks a lot again

            • 3. Re: Method filter combo box datas
              Ilya Shaikovsky Master

              Hi at first I wanted to clarify Mark's suggestion  - it will be good to enhance your dependent selets as shown at http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=ajax&sample=selectsUpdates&skin=blueSky

               

              And about your question. I'm not really sure where the problem appears. You have three combos. Let's say their value's pointed to bean.value1, bean.value2 and bean.value3.  So in your button action you should just check which one of values aren't empty and that will be the fields which user have chosen. Then you could trigger your business logic methods accordingly.

              1 of 1 people found this helpful