users@glassfish.java.net

Re: JSF Table with filter implementation

From: Dominik Dorn <dominik.dorn_at_gmail.com>
Date: Fri, 4 Jun 2010 13:22:32 +0200

put an f:ajax tag into the dropdown, sending the value of the dropdown
back to your bean and calling an action method. in the bean
recalculate the filtered model and then update the table.

something like this

            <h:selectOneMenu id="bundesland"
value="#{searchController.currentAvailableProvince}"

valueChangeListener="#{searchController.availableProvinceChanged}"
>
                <f:selectItem itemLabel="-Bundesland-"/>
                <f:selectItems

value="#{availableProvinceBean.getAvailableProvinces(searchController.currentAvailableCountry.country.id)}"
                        var="item"
                        itemLabel="#{item.province.name}"

                        />
                <f:ajax event="change" execute="@this uni" render="uni
course prof"/>

            </h:selectOneMenu>

when you change the value in the selectOneMenu the method
#{searchController.availableProvinceChanged} is triggered, here you
update your model. then simply rerender the component of the table.


kind regards,
Dominik

-- 
Dominik Dorn
http://dominikdorn.com
Tausche Deine Lernunterlagen auf http://www.studyguru.eu !