p:dataTable rowIndexVar does not work inside p:rowExpansion

UI Components for JSF
Post Reply
KennardConsulting
Posts: 7
Joined: 08 Sep 2010, 02:52

15 Jul 2011, 01:45

Hi guys,

Thanks for all the work you do on PrimeFaces. It's a really top shelf widget library!

I am trying to work around a problem to do with dynamic component creation inside p:rowExpansion. Basically, dyanmic component creation relies upon PreRenderViewEvent, but p:dataTable 'var' is not available during PreRenderViewEvent (for some reason).

Anyway I thought I'd try p:dataTable rowIndexVar instead. But it doesn't seem to work inside p:rowExpansion? For example:

Code: Select all

			<p:dataTable value="#{penguin.all}" var="myVar" rowIndexVar="myRowIndexVar">
				<p:column>
					<p:rowToggler />
				</p:column>
				<p:column>
					<h:outputText value="This works: #{myVar.name}" />
					<br/>
					<h:outputText value="This works: #{myRowIndexVar}" />
				</p:column>
				<p:rowExpansion >
					<h:outputText value="This works: #{myVar.name}"/>
					<br/>
					<h:outputText value="This does not: #{myRowIndexVar}" />
				</p:rowExpansion>
			</p:dataTable>
Is there a workaround for the line marked 'This does not'?

cdorner
Posts: 1
Joined: 28 Sep 2011, 16:13

23 Nov 2011, 20:47

Hi KennardConsulting same problem here.

Did you find any solution?

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

23 Nov 2011, 21:05

You may want to enter this as a bug, and see how PrimeFaces team responds to this. :)
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

23 Nov 2011, 21:13

Why type of dynamic component would you like to be displayed in p:rowExpansion? Can you add the dynamic component/data/data-structure to myVar/penguin.all? I'm asking or recommending that, because per your findings, you've had success displaying the members/attributes of myVar or penguin.all. I've had to do something like that in order to use p:subTable; I developed a data object/structure similar to Showcase example of p:subTable, and that's working well for me on a payroll use case that I coded.

Code: Select all

<p:dataTable value="#{penguin.all}" var="myVar" rowIndexVar="myRowIndexVar">
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests