Dear All,
I'm quite new to MyFaces.... and recently like to display data from a bean returning array of Strings. It works fine with a code but don't display with another. I just repotitioning the code. Hope someone can help me :)
Here is the code that displays the data
===========================================================================
<%@ 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"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE><h:outputText value="#{
prop.appTitle}"/></TITLE>
<link rel="stylesheet" type="text/css" href="" />
</HEAD>
<BODY>
<f:view>
<f:loadBundle basename="
properties.phi" var="prop"/>
<CENTER>
<TABLE BORDER=5>
<TR><TH CLASS="TITLE">
<h:outputText value="#{prop.appTitle}"/></TH></TR>
</TABLE>
<P>
<h:form>
<h:panelGrid id="controlPanel" columns="2" border="1" cellspacing="0">
<h:outputText id="helloInputLabel" value="#{
prop.userIDLabel}"/>
<h:inputText id="helloInput" value="" required="true" />
</h:panelGrid>
<BR /><BR />
<h:panelGroup id="mybody">
<t:dataTable id="data"
styleClass="scrollerTable"
headerClass="standardTable_Header"
footerClass="standardTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
var="car"
value="#{sample.states}"
preserveDataModel="false"
rows="10"
>
<h:column>
<f:facet name="header">
<h:outputText value="Test1" />
</f:facet>
<h:outputText value="#{car[0]}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Test2" />
</f:facet>
<h:outputText value="#{car[1]}" />
</h:column>
</t:dataTable>
<h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered">
<t:dataScroller id="scroll_1"
for=""> fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;">
<f:facet name="first" >
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="last">
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="previous">
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="next">
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="fastforward">
<t:graphicImage url=""
ff.gif" border="1"/>
</f:facet>
<f:facet name="fastrewind">
<t:graphicImage url="" border="1"/>
</f:facet>
</t:dataScroller>
<t:dataScroller id="scroll_2"
for=""> rowsCountVar="rowsCount"
displayedRowsCountVar="displayedRowsCountVar"
firstRowIndexVar="firstRowIndex"
lastRowIndexVar="lastRowIndex"
pageCountVar="pageCount"
pageIndexVar="pageIndex">
<h:outputFormat value="#{prop['outputformat_pages']}" styleClass="standard" >
<f:param value="#{rowsCount}"/>
<f:param value="#{displayedRowsCountVar}"/>
<f:param value="#{firstRowIndex}"/>
<f:param value="#{lastRowIndex}"/>
<f:param value="#{pageIndex}"/>
<f:param value="#{pageCount}"/>
</h:outputFormat>
</t:dataScroller>
</h:panelGrid>
</h:panelGroup>
</h:form>
</f:view>
</CENTER></BODY></HTML>
===========================================================================
Then I repotitioned the <f:view> tag.... like below, which doesn't work.
===========================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ 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>
<HTML>
<HEAD>
<TITLE><h:outputText value="#{prop.appTitle}"/></TITLE>
<link rel="stylesheet" type="text/css" href="" />
</HEAD>
<BODY>
<f:loadBundle basename="properties.phi" var="prop"/>
<CENTER>
<TABLE BORDER=5>
<TR><TH CLASS="TITLE">
<h:outputText value="#{
prop.appTitle}"/></TH></TR>
</TABLE>
<P>
<h:form>
<h:panelGrid id="controlPanel" columns="2" border="1" cellspacing="0">
<h:outputText id="helloInputLabel" value="#{prop.userIDLabel}"/>
<h:inputText id="helloInput" value="" required="true" />
</h:panelGrid>
<BR /><BR />
<h:panelGroup id="mybody">
<t:dataTable id="data"
styleClass="scrollerTable"
headerClass="standardTable_Header"
footerClass="standardTable_Header"
rowClasses="standardTable_Row1,standardTable_Row2"
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
var="car"
value="#{sample.states}"
preserveDataModel="false"
rows="10"
>
<h:column>
<f:facet name="header">
<h:outputText value="Test1" />
</f:facet>
<h:outputText value="#{car[0]}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Test2" />
</f:facet>
<h:outputText value="#{car[1]}" />
</h:column>
</t:dataTable>
<h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered">
<t:dataScroller id="scroll_1"
for=""> fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;">
<f:facet name="first" >
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="last">
<t:graphicImage url=""
last.gif" border="1"/>
</f:facet>
<f:facet name="previous">
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="next">
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="fastforward">
<t:graphicImage url="" border="1"/>
</f:facet>
<f:facet name="fastrewind">
<t:graphicImage url="" border="1"/>
</f:facet>
</t:dataScroller>
<t:dataScroller id="scroll_2"
for=""> rowsCountVar="rowsCount"
displayedRowsCountVar="displayedRowsCountVar"
firstRowIndexVar="firstRowIndex"
lastRowIndexVar="lastRowIndex"
pageCountVar="pageCount"
pageIndexVar="pageIndex">
<h:outputFormat value="#{prop['outputformat_pages']}" styleClass="standard" >
<f:param value="#{rowsCount}"/>
<f:param value="#{displayedRowsCountVar}"/>
<f:param value="#{firstRowIndex}"/>
<f:param value="#{lastRowIndex}"/>
<f:param value="#{pageIndex}"/>
<f:param value="#{pageCount}"/>
</h:outputFormat>
</t:dataScroller>
</h:panelGrid>
</h:panelGroup>
</h:form>
</f:view>
</CENTER>
</BODY></HTML>
===========================================================================
What is the problem anyway ?
Regards,
Feris
- DataTable don't show up Feris Thia
- RE: DataTable don't show up David Friedman
- Re: DataTable don't show up Feris Thia
- Re: DataTable don't show up Feris Thia

