I have a also encountered this problem many time, and haven't found any
reasonable way of doing it in JSF other than getting the value from the drop
down as a query parameter and generating the table data directly from the
getter.

For example:

private List data;

public List getTableData()
{
        if (data == null)
        {
                String selection = getQueryParameter("formData:myDropdown");
// The parameter can be taken from the faces context, I don't remember the
exact code now...
                data = myDAO.getTableData(selection);
        }

        Return data;
}

Hope it helps, or someone else give better solution.

Guy.


-----Original Message-----
From: Janap [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 6:43 PM
To: [email protected]
Subject: Datatable Filtering



Hello all ,

I need to filter rows of the Datatable depending on the criteria entered by
the user. The criteria is in the form of selectBox right above the
Datatable.

So , after the user enters the criteria and submits the form  I  capture the
criteria and generate a new query and then load the Datatable with the new
query. This is how I want it to work.

I implemented it already but since my Datatable is loaded in the Apply
Request Values phase, I am not able to read the new values of criteria
before that. I am using immediate="true" and value binding on the selectBox
component.

What is the correct way to do this?? Do I have to use component binding to
get new values of selectBox before the Datatable model reloads or do I need
to push Datatable model reloading to the UpdateModel phase.

I am using Request scope all throughout my application.

Thx for the help,
Janap.


-- 
View this message in context:
http://www.nabble.com/Datatable-Filtering-tp18385566p18385566.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to