Using datatable through a composite component

UI Components for JSF
Post Reply
spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

07 Nov 2011, 20:51

I'm using a p:datatable through a composite component.
I'm creating columns dynamically with jstl c:foreach children.

Code: Select all

<c:forEach var="child"  items="#{cc.children}">
						<p:column headerText="#{child.label}" sortBy="#{child.value}">
						  <h:outputText value="#{child.value}" />
						</p:column>
				</c:forEach>
it works fine and if #{child.value} == #{car.year} that column shows the car´s year data as expected.

However, with sortBy attribute there's a problem because primefaces collect "value" from child.value as a sortField not "year" from car.year.
is there a way to workaround that?

spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

08 Nov 2011, 21:07

I was thinking on hacking primefaces to blend it to use a different sort attribute.

Where does the attribute column.sortBy is passed (through a click I suppose) to the table.sortBy attribute?
is it in Javascript?

spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

08 Nov 2011, 21:48

I've checkout the project from svn and couldn't find the primefaces.js at the META-INF/resources/primefaces/primefaces.js does the trunk version has this file?

spinner
Posts: 31
Joined: 29 Nov 2010, 18:10

09 Nov 2011, 13:17

oh I see, it generates the primefaces.js within all the component's js.

is there a way to tell primefaces to use another javascript file?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests