setting default value in primefaces datatable Filter

前端 未结 4 1291
日久生厌
日久生厌 2020-12-06 03:01

I am using primefaces v3.5.On the datatable I am using filter on one column. How can I set a default value to the filter while loading the page Itself.

4条回答
  •  囚心锁ツ
    2020-12-06 03:50

    Ideally, obtaining a reference to the datatable (either by binding the view datatable to a backing bean representation or walking the DOM tree) and doing this

        Map theFilterValues = new HashMap();
        theFilterValues.put("filterColumn","fooValue");
        myDataTable.setFilters(theFilterValues);
    

    Will set a default text value, but might not apply the filter.

    Alternatively, this post in the primefaces issues queue suggests a jquery based option

        
    

提交回复
热议问题