-
1. Re: Method filter combo box datas
mp911de Sep 4, 2011 9:13 AM (in response to bouz78)1 of 1 people found this helpfulHi,
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
-
2. Re: Method filter combo box datas
bouz78 Sep 5, 2011 4:06 AM (in response to mp911de)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 Sep 5, 2011 2:17 PM (in response to bouz78)1 of 1 people found this helpfulHi 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.