i cant understnad your problem in 100%, but i think it may have something in common with problem that i posted few day ago...

if you have:

<h:selectOneMenu value="#{bean.selected_id}">
        <f:selectItems value="#{bean.options}"/>
<h:selectOneMenu/>

i assume that bean.options is array of SelectItem...
if you construct each SelectItem like that: new SelectItem("string_option_id","string_option_value")
make sure that type of bean.selected_id is also String


i have wasted few days because my bean.selected_id type was int and SelectItem class was constructed with two String args:D

Sławek Sobótka

Hi All,

I have 6 drop downs on a jsf page which act as filters.
i.e. the second drop down depends on the value selected in the first and so on.
When i go to this page, the drop downs should display the selected values from the database if any or default values.
Now, for displaying the values, i populate the bean and use the value attribute of
<h:selectOneMenu> and <f:selectItems> to highlight the values from the database.
valueChangeListener() are attached with each dropdown to get the new value and change the values of next drop
dropdown.
Now , i am able to display the values from the database and i am also able to change the values of dropdowns.
But the problem is whenever i click the submit button to save the changed values, the page simply refreshes and the
drop down values become the same as in the database before.
Ideally, the bean values which display the data from database should also be able to get the new values and save them to database.
The scope of the page data bean is session and of the managed bean is request.


Has any one come across this problem?

Any ideas how to make this work?


Thanx & Regards, Sunil





Reply via email to