Your type
is not set at all, so it will always be "D".
Even when I change the selectonemenu.
You may check it yourself by using System.out.println
in the setter function.
You need to specify when to activate the <f:ajax>
.
What's more, execute
attribute is to submit the information, so if you didn't type anything and select Food option, the validation will failed and thus the backing bean will not executed.
If you try typing something in Name and Price field and select Food, you will find the Size field disappear.
So, use event
and delete execute
.
Like this:
<f:ajax event="change" render="selectInputPanel"/>
I tried it and it works.