This tag is like dataTable tag but the difference between the two is that it does not render a table. In this tag the data rows are controlled and rendered by the use of "layout" attribute. It supports three layouts "simple", "unorderedList", "orderedList". The default value is simple. When "simple" is used the items are rendered normally, when "unorderedList" is used the list is rendered as an HTML unordered list and in the case of "orderedList", the list is rendered as an HTML ordered list.
Code Description :
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk"
prefix="t"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>t:dataList example</title>
<style type="text/css">
<!--
.dataListStyle {
color: green;
background-color: #D0E6E0;
padding: 3;
}
-->
</style>
</head>
<body >
<f:view>
<h:form id="form1" >
<t:dataList id="dt1" value="#{TableBean.perInfoAll}"
var="item" layout="orderedList" first="0"
rows="4" dir="LTR"
itemStyleClass="dataListStyle">
<t:outputText value="#{item.firstname}"></t:outputText>
<f:verbatim> </f:verbatim>
<t:outputText value="#{item.lastname}"></t:outputText>
<f:verbatim> </f:verbatim>
<t:outputText value="#{item.phone}"></t:outputText>
</t:dataList>
</h:form>
</f:view>
</body>
</html>
|
TableBean.java :
package net.roseindia.web.ui;
|
Rendered Output :

Html Source Code :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>t:dataList example</title>
<style type="text/css">
<!--
.dataListStyle {
color: green;
background-color: #D0E6E0;
padding: 3;
}
-->
</style>
</head>
<body >
<form id="form1" name="form1" method="post"
action="/tomahawk_tags/pages/dataList.jsf"
enctype="application/x-www-form-urlencoded">
<ol id="form1:dt1" dir="LTR">
<li class="dataListStyle">SUSHIL
KUMAR
9891444444</li>
<li class="dataListStyle">CHANDAN
KUMAR
9911666666</li>
<li class="dataListStyle">RAVI
KANT
9313888888</li>
<li class="dataListStyle">ANDY
ROBERTSON
9911222222</li>
</ol>
<input type="hidden" name="form1_SUBMIT" value="1" />
<input type="hidden" name="javax.faces.ViewState"
id="javax.faces.ViewState" value="rO0ABXVyABNbTGphdmEubGFu
Zy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgBHb3JnLmFwYWNoZS5teW
ZhY2VzLmFwcGxpY2F0aW9uLlRyZWVTdHJ1Y3R1cmVNYW5hZ2VyJFRyZWVT
dHJ1Y3RDb21wb25lbnRGWRfYnEr2zwIABFsACV9jaGlsZHJlbnQASltMb3
JnL2FwYWNoZS9teWZhY2VzL2FwcGxpY2F0aW9uL1RyZWVTdHJ1Y3R1cmVN
YW5hZ2VyJFRyZWVTdHJ1Y3RDb21wb25lbnQ7TAAPX2NvbXBvbmVudENsYX
NzdAASTGphdmEvbGFuZy9TdHJpbmc7TAAMX2NvbXBvbmVudElkcQB+AARb
AAdfZmFjZXRzdAATW0xqYXZhL2xhbmcvT2JqZWN0O3hwdXIASltMb3JnLm
FwYWNoZS5teWZhY2VzLmFwcGxpY2F0aW9uLlRyZWVTdHJ1Y3R1cmVNYW5h
Z2VyJFRyZWVTdHJ1Y3RDb21wb25lbnQ7uqwnyBGFkKoCAAB4cAAAAAFzcQ
B+AAJ1cQB+AAcAAAABc3
.............
............." /></form>
<!-- MYFACES JAVASCRIPT -->
</body>
</html>
|
This tag contains attributes given below :
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Tomahawk dataList tag
Post your Comment