This content has been marked as final.
Show 4 replies
-
1. Re: filterMethod and selectOneListbox
monkeyden Oct 13, 2008 3:34 PM (in response to monkeyden)Can anyone answer why this example would not work? It's nearly identical to the example. The value binding method, setSelectedCategory(), is never called. Expected behavior would be:
1. Change select box
2. Call value binding mutator
3. Call filter method for each item in the data list
The filterMethod method is called for each item in the list, but the category is always null because the mutator is never called.
Thanks -
2. Re: filterMethod and selectOneListbox
ilya_shaikovsky Oct 14, 2008 6:46 AM (in response to monkeyden)add rich:messages to the page.
-
3. Re: filterMethod and selectOneListbox
monkeyden Oct 14, 2008 12:10 PM (in response to monkeyden)Thanks for that, but I already had one. There are no errors.
-
4. Re: filterMethod and selectOneListbox
monkeyden Oct 14, 2008 5:46 PM (in response to monkeyden)Turns out it was failing as a result of the seam tags:
<s:selectItems value="#{categories}" var="category" label="#{category.name}" noSelectionLabel="All Categories"/> <s:convertEntity />
It must be using a different mechanism when it appears in the facet tag. To provide some perspective, the Seam tags resolve the selected item to the relevant entity and allow me to call this value binding method:public void setSelectedCategory(Category selectedCategory)
It works in the traditional case (simple in a form) but for some reason this value binding does not happen for filtering. The solution in my case was the use "JSF proper" SelectItems:<f:selectItem itemLabel="All Categories" itemValue=""/> <f:selectItems value="#{categorySelectItems}"/>
If I am right, any insight from the omniscient among us is much appreciated.
P.S.
Ilya, you were correct. I had a h:messages instead of rich:messages. The latter revealed the issue. Thanks