Datatable default filter on column

UI Components for JSF
Post Reply
floureja
Posts: 1
Joined: 17 Oct 2011, 19:08

17 Nov 2014, 17:54

Hi ,
I read a lot of post but I didn't found the answer.

I have a page with a datatable and a filter on one column.

I need to call this page from another using http param like "http:/myserver/app/page.xhtml?monfiltre=toto"
I hope that when i will success in filtering the page using a default value I will success in calling it using parameters


I defined the filter with:
...
<p:tab id="idTabAugust" title="AUGUST">
<p:dataTable
value="#{qABean.lstAugust}" id="dtAugust"
var="varAugust" widgetVar="WidgetAugust"
emptyMessage="No records found">
...
<p:column headerText="TNSX" sortBy="#{varAugust.eqpt_insp}" filterBy="#{varAugust.eqpt_insp}" filterMatchMode="contains">
<h:outputText value="#{varAugust.eqpt_insp}" />
</p:column>
...

If I enter manually the filter value in the page it is working .

if I modify the xhtml code like
<p:column headerText="TNSX" sortBy="#{varAugust.eqpt_insp}" filterBy="#{varAugust.eqpt_insp}" filterMatchMode="contains" filterValue="2">
<h:outputText value="#{varAugust.eqpt_insp}" />
</p:column>

The list is not filtered. I try to add the javascript code
<script type="text/javascript">
$j = jQuery;
$j(document).ready(function () {
WidgetAugust.filter();
});
</script>
or
<script type="text/javascript">
$j = jQuery;
$j(document).ready(function () {
PF('WidgetAugust').filter();
});
</script>
in the header or at the end of the page. It is not working.
with chrome debugger I have "WidgetAugust is not defined"

I am doing something wrong but I don't uderstand what it is.

I am using Primefaces 5.0.

thanks to help me
primefaces 5.0, JSF2.1, tomcat7.0.54

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests