IDs of datatable columns are are wrong, p:columns bug?

UI Components for JSF
Post Reply
greenf
Posts: 1
Joined: 14 Oct 2010, 17:59

14 Oct 2010, 18:34

I try to use PF-2.2.M1-SNAPSHOT for datatable with dynamic columns. I see that the following code in JSF2 component does not work correctly:

Code: Select all

<p:dataTable value="#{cc.attrs.managedBean.dataSource.rows}" 
				var="currRow" id="dataTable" rowIndexVar="rowIndex">
			<p:columns value="#{cc.attrs.managedBean.dataSource.columnNames}" 
					var="columnName" columnIndexVar="colIndex">
				<p:outputPanel id="cell_#{rowIndex}_#{columnName}">
					<h:outputText value="#{currRow.getCellValue(columnName)}"/>
				</p:outputPanel>		
			</p:columns>
		</p:dataTable>
The problem is with dynamic cell ID. The 'columnName' variable appears twice: in 'id' attribute value and as parameter for cell text. The result html is:

Code: Select all

<td><span><span id="j_idt56:gridExample:dataTable:1:cell__">BMW</span></span></td><td><span><span id="j_idt56:gridExample:dataTable:1:cell__">B4</span></span></td>
So, datatable can deal with dynamic text, but not with dynamic IDs. Is it a bug or I do something wrong?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests