Global Filter returns error on line 1 at column 224: Extra content at the end of the document

UI Components for JSF
Post Reply
primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

22 Nov 2021, 18:12

My table

<p:dataTable id="table" widgetVar="table" stripedRows="true" reflow="true"
value="#{view.dtos}" filteredValue="#{view.filteredDTOs}"
globalFilterFunction="#{view.globalFilter}"
var="dto" selection="#{view.selectedDTOs}" rowKey="#{dto.Id}" paginator="true"
rows="10" rowSelectMode="add">


My global filter:

<h:panelGroup style="margin: 0px 5px;" class="filter-container ui-input-icon-left">
<i class="pi pi-search"></i>
<p:inputText id="globalFilter" value="#{view.globalFilterValue}" onkeyup="PF('table').filter()" placeholder="Global Search"/>
</h:panelGroup>


My dependencies:

<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>2.3.5</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>11.0.0-RC2</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>rain</artifactId>
<version>2.0</version>
</dependency>
</dependencies>


I get this error embedded in the <parsererror> tag that comes back in ajax:

error on line 1 at column 224: Extra content at the end of the document


BTW, I had to add value="#{view.globalFilterValue}" because it kept giving me this error:

cannot validate component with empty value: form:table:globalFilter

Full response:

<?xml version="1.0" encoding="UTF-8"?><partial-response id="j_id__v_0"><changes><update id="javax.faces.Resource"><![CDATA[]]></update><update id="form:table"><![CDATA[]]></update></changes></partial-response><partial-response><error><error-name>org.apache.myfaces.view.facelets.el.ContextAwareELException</error-name><error-message><![CDATA[javax.el.ELException: java.lang.NullPointerException]]></error-message></error></partial-response>

primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

22 Nov 2021, 19:51

I figured out the error. My globalFilter method was throwing an exception.

primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

22 Nov 2021, 19:52

Still don't understand why I had to provide a value attribute, when the showcase doesn't.

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

23 Nov 2021, 15:15

Glad you got it resolved...
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

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

23 Nov 2021, 15:17

normally you dont need a value attr, its just a hint from MyFaces that it cant validate such a input
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests