Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rich:dataTable is only showing header not Table record  RSS feed

 
Shikha bajpai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<f:loadBundle basename="MessageResources" var="msgs" />
<h:form id="ntfnReportTable" style="border:1">
<h:panelGrid columns="1" width="100%" id="notificationSearchTableGrid"
border="0">
<rich:panel styleClass="panelNoBorder">



<rich:dataTable>

<f:facet name="header">
<h:outputText value="#{msgs.logSearch_listOfSuccess}" />
</f:facet>

<f:facet name="header">
<rich:columnGroup>
<h:column>
<h:outputText styleClass="headerText" value="Make" />
</h:column>
<h:column>
<h:outputText styleClass="headerText" value="Model" />
</h:column>
<h:column>
<h:outputText styleClass="headerText" value="Price" />
</h:column>
<h:column>
<h:outputText styleClass="headerText" value="Mileage" />
</h:column>
</rich:columnGroup>
</f:facet>

<h:column>
<h:outputText value="Process" />
</h:column>
<h:column>
<h:outputText value="Application Id" />
</h:column>
<h:column>
<h:outputText value="Component ID" />
</h:column>
<h:column>
<h:outputText value="Dev" />
</h:column>
</rich:dataTable>





</rich:panel>
</h:panelGrid>
</h:form>
</ui:composition>

I tried many times but always getting only Table Header. Above file is called from below file:

<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

<!--
Replace path to template, title, header and body
with actual data.
-->
<ui:composition template="../../WEB-INF/template/common.xhtml">
<ui:define name="title">WILEY(Knowledge For Generations)</ui:define>
<ui:define name="header">
<ui:include src="../../WEB-INF/template/header.xhtml" />

</ui:define>
<ui:define name="menu">
<ui:include src="../../WEB-INF/template/menu.xhtml" />
</ui:define>
<ui:define name="body">
<f:loadBundle basename="MessageResources" var="msgs" />
<div align="center">
<h:outputLabel value="#{msgs.menu_dashboardAll}"
styleClass="homePageText2" />
</div>
<ui:include src="overAllTxnVolTable.xhtml" />
</ui:define>
<ui:define name="footer">
<ui:include src="../../WEB-INF/template/footer.xhtml" />
</ui:define>
</ui:composition>

</html>

Please help not getting what is the actual error.. no error is on view or console
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a very odd looking dataTable. You don't seem to have defined a Model to back it up or a row variable to use as a cursor.

If you attempt to display a table with no rows, I'd expect only a header. Or - since the rich dataTable supports it, the "no data" row - if you've defined it.

Incidentally, use the "Code" button when you want to include formatted text such as Java sample code or XML. It makes it more readable.
 
Shikha bajpai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim, I was using data model earlier, but as not getting rows in page I removed them to check what is actual issue. Now I am only trying to put simple datatable, where I coded as below. Till application Id code is running fine but <h:outputText where I put hardcoded value is not coming up. In Page source I can see <tbody> is coming blank :(

 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your sample template has 2 outputText elements in it, but they're both in column headers, if I'm reading it correctly.

But you won't see a proper table unless there's an actual non-empty model attached to it via the "value=" dataTable attribute.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!