• Post Reply Bookmark Topic Watch Topic
  • New Topic

nested datatable not working

 
Pinal N Patel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I don't know what I am doing wrong here but for some reason, I am not able to list Table and a Calendar on the same row (next to each other). I have created a outer table using dataTable to have two columns (one for Table and the other for Calendar). Any input will be appreciated.

FYI: I am using Facelets and MyFaces.

Thanks,
Pinal

<!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:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="/WEB-INF/layout/basic_layout.xhtml">
<ui:define name="content"><h:form id="foodForm">
<t:dataTable id="outerTable" border="10">
<t:column>
<t:dataTable id="foodTable" border="1"
value="#{foodBean.foodTableInfo}" var="food" rendered="true">
<t:column>
<f:facet name="header">
<tutputText value="Item" id="h1" />
</f:facet>
<tutputText value="#{food.item}"></tutputText>
</t:column>
<t:column>
<f:facet name="header">
<tutputText value="Calories" id="h2" />
</f:facet>
<tutputText value="#{food.calories}"></tutputText>
</t:column>
<t:column>
<f:facet name="header">
<tutputText value="Fat(Calories)" id="h2" />
</f:facet>
<tutputText value="#{food.fatCalories}"></tutputText>
</t:column>
<t:column>
<f:facet name="header">
<tutputText value="Portion" id="h2" />
</f:facet>
<tutputText value="#{food.portion}"></tutputText>
</t:column>
</t:dataTable>
</t:column>
<t:column>
<t:inputCalendar currentDayCellClass="currentDayCell"
dayCellClass="dayCell"></t:inputCalendar>
</t:column>
</t:dataTable>
</h:form></ui:define>
</ui:composition>
</html>
 
Pinal N Patel
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed it by using PanelGrid with columns=2.

Regards,
Pinal
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next time, please post your source code using the UBB code tags.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!