This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

nested datatable not working

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Next time, please post your source code using the UBB code tags.
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic