You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Ajit.T" <cy...@gmail.com> on 2006/06/14 20:19:22 UTC

Datatable components in a page

Hi , 
     This is my Jsf page which is suppose to house multiple datatables in
it(as of now the code has two datatables). .  This page also contains many
HTML tags like <div> & <table>. The datatables are nested within these HTML
tags. This page is been rendered within a frameset (I initially had problems
populating the datatables in a page called within a frameset when I was
using Myfaces 1.1.1 which was resolved using the higher version viz.
Myfaces1.1.2)
Each of the datatable  has a different dataModel class.  When the page loads
, only the first datatable is populated with data while the second Datatable
remains empty though the headers are been rendered. 
To avoid problems due to mixing of HTML & JSF tags, I also tried using an
htmlLib.jar (third party jar which allows to prefix <htm:> with every html
tag) and also <t:htmlTag> of tomahawk 1.1.2  but these weren’t of much help
either.
Please let me know what am I missing around here. approachin deadlines...!
/-------------------------jsf page
code-------------------------------------------------/

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<f:view>
<f:loadBundle basename="com.server.gui.resource.messages" var="messages"/>

<html>
     <head>
       </head>
           <body >
            <h:form>
<h:panelGroup id="lefttoctables">
 <h:messages globalOnly="true" showDetail="true"/>
         <f:verbatim><table border="0" cellspacing="0" cellpadding="0"
width="100%" class="navClosed" id="all"></f:verbatim>
												<f:verbatim><div class="row-highlighted"
>TAB-1</div></f:verbatim>
				<f:verbatim><tr></f:verbatim>
				<f:verbatim><td></f:verbatim>
				<t:div styleClass="tree">
													           <t:dataTable id="alltoctable" border="0"
										                        styleClass="scrollerTableNoWidth"
										                        headerClass="standardTable_Header"
										                        footerClass="standardTable_Header"
										                       
rowClasses="standardTable_Row1,standardTable_Row2"
										                       
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
										                        var="toclist"
										                        binding="#{firstTable.model}"
										                        value="#{firstTable.tocdataModel.model}"
										                        rows="#{firstTable.tocdataModel.rows}">
										                   <h:column>
										                       <f:facet name="header">
										                          <h:outputText value="Date " />
										                       </f:facet>
										                     <h:outputText
value="#{toclist.primaryDateTime.date}" />	                               
										                   </h:column>
										                
														   <h:column>
										                       <f:facet name="header">
										                          <h:outputText
value="#{messages['label_shortname']}" />
										                       </f:facet>
										                          <h:commandLink id="getdoc" action
="rep_doc" actionListener="#{docaction.fetchDocument}"
target="contentFrame1">
										                          <h:outputText
value="#{toclist.shortName}"/>	
										                          <f:param name="shortname"
value="#{toclist.shortName}"/>
										                          <f:param name="repkey"
value="#{toclist.repositoryKey.originalStr}"/>
										                          <t:updateActionListener
property="#{docaction.documentRequested}" value="#{toclist.shortName}"/>
										                          </h:commandLink>  
										                               
										                   </h:column>
										                   </t:dataTable>
		     <h:message for="alltoctable" showDetail="true"/> 
					</t:div>
					<f:verbatim></td></f:verbatim>
					<f:verbatim></tr></f:verbatim>
					<f:verbatim></table> </f:verbatim>
					<f:verbatim><table border="0" cellspacing="0" cellpadding="0"
width="100%" class="navClosed" id="lab"></f:verbatim>
					<f:verbatim><tr></f:verbatim>
					<f:verbatim><td></f:verbatim>
														<f:verbatim><div class="row-normal" >TAB-2</div></f:verbatim>
					<f:verbatim></td></f:verbatim>
					<f:verbatim></tr></f:verbatim>
					<f:verbatim><tr></f:verbatim>
					<f:verbatim><td></f:verbatim>
						<t:div styleClass="tree">
													   	<t:dataTable id="sectable" border="0" bgcolor="red"
								                        styleClass="scrollerTableNoWidth"
								                        headerClass="standardTable_Header"
								                        footerClass="standardTable_Header"
								                       
rowClasses="standardTable_Row1,standardTable_Row2"
								                       
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
								                        var="sec"
								                        binding="#{secondTable.model}"
								                        value="#{secondTable.labModel.model}"
								                        rows="#{secondTable.labModel.rows}">
								                        <h:message for="sectable"
showDetail="true"/>                              
								                   	<h:column>
								                       <f:facet name="header">
								                          <h:outputText value="Date " />
								                       </f:facet>
								                         <h:outputText
value="#{sec.primaryDttm.date}" />	                   
								                   	</h:column>
												<h:column>
								                       <f:facet name="header">
								                          <h:outputText
value="#{messages['label_shortname']}" />
								                       </f:facet>
								                         <h:outputText value="#{sec.shortName}" />	                   
								                    </h:column>
								                       
								                      </t:dataTable>		
					</t:div>
					<f:verbatim></td></f:verbatim>
					<f:verbatim></tr></f:verbatim>
					<f:verbatim></table></f:verbatim> 

	</h:panelGroup>
	   </h:form>
 </body>
</html>
</f:view>

--
View this message in context: http://www.nabble.com/Datatable-components-in-a-page-t1787812.html#a4870135
Sent from the MyFaces - Users forum at Nabble.com.