• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

nested datatable not working

 
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">
<t:outputText value="Item" id="h1" />
</f:facet>
<t:outputText value="#{food.item}"></t:outputText>
</t:column>
<t:column>
<f:facet name="header">
<t:outputText value="Calories" id="h2" />
</f:facet>
<t:outputText value="#{food.calories}"></t:outputText>
</t:column>
<t:column>
<f:facet name="header">
<t:outputText value="Fat(Calories)" id="h2" />
</f:facet>
<t:outputText value="#{food.fatCalories}"></t:outputText>
</t:column>
<t:column>
<f:facet name="header">
<t:outputText value="Portion" id="h2" />
</f:facet>
<t:outputText value="#{food.portion}"></t:outputText>
</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
 
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic