Zero left on filter

UI Components for JSF
Post Reply
Rafaelfr1
Posts: 32
Joined: 09 Mar 2015, 16:03

15 Feb 2018, 22:15

Hello, I'm developing a DataTable, which has a column for barcode query. But every time the code is read, if there are zeros the left is informed to the filter field.

Example:
Item code 23.
Code read on barcode reader: 000023

So, in the datatable filter, the item is not found because there is no code item 000023, it only exists if it were 23.

Is there any way to make the filter disregard these zeros to the left of the code?

Code: Select all

            <p:column headerText="#{l.Code_Bar}" sortBy="#{bean.bar}" filterBy="#{bean.bar}" footerText="#{l.Code_Bar}" filterMatchMode="contains">
                <h:outputText value="#{bean.bar}" />
            </p:column>
I also have the globalFilter implemented, is it possible to do this in this filter too?

Code: Select all

<p:inputText id="globalFilter" onkeyup="PF('table').filter()" style="margin-left: 5px; min-width: 200px" />

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

17 Feb 2018, 15:28

maybe try the filterFunction="" attribute and define your own filter function.

https://stackoverflow.com/questions/237 ... erfunction
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests