views:

13

answers:

1

I need to pass additional parametrs to my suggest method.

For example:

I have one selectList in which i choose a country. In another inputfield i have suggestionbox, where i can choose city from that country. So i need to pass to my suggest method 2 values:

  1. String, which user has typed in suggestionfield
  2. Country, which user has chosen from countries selectList.

How can i do it?

+1  A: 

You don't have to change the signature of the suggestion method.

Simply bind the value of the selected selectList in the bean, and then put the suggestionMethod in the same bean.

In this way when the suggestion action will fire you will find the selected Country in the bean and you can filter with it.

volothamp
You will also need to set immediate="true" in the country list. This means that the value in the bean is updated as soon as the value is selected (actually on the onblur event)
MatthieuF