|
|
|
6. Tomahawk htmlTag tag
This tag is used to use html tag for its child component. This provides “value” attribute to specify the name of the html tag to be used. For example, if we want to make any string as bold then enclose it within <t:html> tag and set its value as “b” because in html to make any character bold we use <b> tag. If we don’t provide any value to the value attribute then all its child component are rendered but no html tag is applied on them.
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”%>
<f:view>
<t:document>
<t:documentHead>
<meta http-equiv=”Content-Type”
content=”text/html;charset=iso-8859-1">
<title>t:htmlTag example</title>
</t:documentHead>
<t:documentBody >
<h:form>
<t:htmlTag value=”h1">t:htmlTag Example</t:htmlTag>
<t:htmlTag value=”b”><i>Bold & Italic font</i></t:htmlTag>
<t:htmlTag value=”br”/>
<t:htmlTag value=”b” rendered=”false” >
Bold property will not be applied here.
</t:htmlTag>
</h:form>
</t:documentBody>
</t:document>
</f:view>
Rendered Output :
|
|
7. Tomahawk dataList tag
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”%>
<f:view>
<t:document>
<t:documentHead>
<meta http-equiv=”Content-Type”
content=”text/html;charset=iso-8859-1">
<title>t:htmlTag example</title>
</t:documentHead>
<t:documentBody >
<h:form>
<t:htmlTag value=”h1">t:htmlTag Example</t:htmlTag>
<t:htmlTag value=”b”><i>Bold & Italic font</i></t:htmlTag>
<t:htmlTag value=”br”/>
<t:htmlTag value=”b” rendered=”false” >
Bold property will not be applied here.
</t:htmlTag>
</h:form>
</t:documentBody>
</t:document>
</f:view>
|
|
Nov
2007 | Java Jazz Up |26 |
|
|
|
View All Topics |
All Pages of this Issue |
Pages:
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53 ,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63 ,
64,
65 ,
66 ,
67 ,
68 ,
69 Download PDF |
|
|
|
|
|
|
|
|
|