dataTable with filterBy strange issue

UI Components for JSF
Post Reply
rene.guenther
Posts: 56
Joined: 19 Oct 2009, 15:56

17 Feb 2010, 16:54

One of my columns looks like:

Code: Select all

<p:column >  
        <f:facet name="header">
            <h:outputText value="#{text['statement.travellerName']}" escape="false"/>
        </f:facet>
        <h:outputText value="#{item.document.recordData.travellerName}" escape="true"/>
    </p:column>
if I add the filterBy:

Code: Select all

   <p:column filterBy="#{item.document.recordData.travellerName}">  
        <f:facet name="header">
            <h:outputText value="#{text['statement.travellerName']}" escape="false"/>
        </f:facet>
        <h:outputText value="#{item.document.recordData.travellerName}" escape="true"/>
    </p:column>
The functionality is there. But the following tags are being added to the HTML source code:

Code: Select all

</body>
</html>
//]]>
</script></form>
That happens right after the regular </form> which is related to my </h:form>. I checked that there is no extra opening <form> in the HTML source code.
I only recognized the issue because of the characters //]]> being displayed at the bottom of the page when it is rendered by the browser.

Do you have any ideas what might cause the issue?

Thanks
Rene

rene.guenther
Posts: 56
Joined: 19 Oct 2009, 15:56

17 Feb 2010, 18:24

while looking up documentation again, I found
Setting a column filter is as easy as specifying filterBy attribute to true.
I assume that this is outdated? Or am I using filterBy attribute the wrong way?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

17 Feb 2010, 18:59

Oops, documentation does not seem to be updated, I need to fix that, thanks for the heads up.

Rene can you post the whole datatable please?

rene.guenther
Posts: 56
Joined: 19 Oct 2009, 15:56

17 Feb 2010, 19:47

The reduced xhtml is as follows, I removed everything that is not required and still the issue remains:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core">

<f:view>
    <head>
        <p:resources/>
    </head>
    <body>
    <h:form prependId="false">
        <p:dataTable var="item"
                     value="#{referenceFieldTypeList.all}">
            <p:column filterBy="#{item.description}">
                <f:facet name="header">
                    <h:outputText value="description"/>
                </f:facet>
                <h:outputText value="#{item.description}"/>
            </p:column>
        </p:dataTable>
    </h:form>
    </body>
</f:view>
</html>

I am using myfaces-1.2.8 with facelets.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Feb 2010, 13:01

It might be a myfaces compatibility problem, in myfaces there're some problems with handling CDATA rendering, mojarra handles it better. There are eve some code in PrimeFaces to workaround these issue but I can't figure out the reason for this case.

Rene is that possible for you to try with Mojarra instead of MyFaces? Would that require much work?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 8 guests