3

Thanks to all those who are responding to the problems of the developers.

I am facing some issue with primefaces 5.0 in datatable.

i am having one datatable with 14 records into that backed by list as usual. It was working fine till the time i added spring into my JSF application.

list backed in datatable is getting data from database though one method which is setting the values into the list(not filling data in getter method).

now when i am checking in getter of the list, it is having 14 records into the list. The problem is datatable is not showing the values for those records. It is showing blank rows for that. It is showing 14 blank records for that.

if i am trying to print the value of the records of list it is printing fine. i tried to see the type of the records of the list that is also the desired type.

if i will try to print the perticular value of the field of the record of the list outside of the datatable that is also printing fine in xhtml page but it is not showing the same into the datatable.

i didn't change any sysntex as it was working fine before adding spring into it.

please help me for this. Thanks to all of you. I am showing the xhtml code below.

<p:dataTable id="datatable" var="variable" value="#{myClass.existingRecordList}" resizableColumns="true" 
 paginator="true" rows="10" editable="true" style="font-size:12px" paginatorAlwaysVisible="true"
 paginatorPosition="top" rowIndexVar="rowIndex" rowsPerPageTemplate="5,10,15,20"
 paginatorTemplate="Displaying {RowsPerPageDropdown} records / page {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport}"
 currentPageReportTemplate="{startRecord} - {endRecord} of {totalRecords}" >
 <p:columnGroup type="header" >
  <p:row>
   <p:column headerText="#" style="text-align:center;white-space:normal;width:25px"/>
   <p:column headerText="Field1" style="text-align:center;white-space:normal;width:50px;vertical-align:bottom"
    sortBy="#{variable.field1}" filterBy="#{variable.field1}" filterMatchMode="contains" rendered="#{otherClass.field1}" />
   <p:column headerText="Field2" style="text-align:center;white-space:normal;width:50px;vertical-align:bottom"
    sortBy="#{variable.field2}" filterBy="#{variable.field2}" filterMatchMode="contains" rendered="#{otherClass.field2}"/>
   <p:column headerText="Field3" style="text-align:center;white-space:normal;width:50px;vertical-align:bottom"
    sortBy="#{variable.field3}" filterBy="#{variable.field3}" filterMatchMode="contains" rendered="#{otherClass.field3}"/>
  </p:row>
 </p:columnGroup> 
 <p:column headerText="#" style="text-align:center;white-space:normal;width:20px" exportable="false">
  <h:outputText value="#{rowIndex+1}" style="text-align:center"/> <!-- This is printing the value -->
 </p:column>
 <p:column headerText="Field1" style="text-align:center;" rendered="#{otherClass.field1}">
  <h:outputText value="#{variable.field1}" style="text-align:center;white-space:normal"/><!-- This is not printing the value showing blank-->
 </p:column>
 <p:column headerText="Field2" style="text-align:center;" rendered="#{otherClass.field2}">
  <h:outputText value="#{variable.field2}"/> <!-- This is not printing the value showing blank-->
 </p:column>
 <p:column headerText="Field3" style="text-align:center;" rendered="#{otherClass.field3}"> 
  <h:outputText value="#{variable.field3}"/> <!-- This is not printing the value showing blank-->
 </p:column>
</p:dataTable>
<h:outputText value="This is the value #{myClass.existingRecordList.get(0).field1}"></h:outputText> <!-- This is printing the value -->
NickyPatel
  • 503
  • 4
  • 11
  • Have you inspected with firebug or any other browser inspector if the content of a cell is blank/null or if it has the expected result? Also...start from the basics to find out where the problem is. I suggest you to make a simple datatable only with the `value` and `var` attributes, and the basics columns. – Pellizon Jan 08 '15 at 10:09
  • Thanks Pellizon for the quick reply. I tried that also but not succeed. I was using mozilla when it was working fine. I tried to see through bugzilla in mozilla, it is not showing any value there. – NickyPatel Jan 08 '15 at 10:17
  • If i am using simple h:datatable nothing is visible there. Not even column headers. If i am putting border it is showing empty table with less than 1mm space in each cell. – NickyPatel Jan 08 '15 at 11:51
  • If i am removing spring it is showing the data. – NickyPatel Jan 09 '15 at 10:26

0 Answers0