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 value attribute then all its child component are rendered but no 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 :

Html Source Code :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>t:htmlTag example</title>
</head>
<body>
<form id="_idJsp3" name="_idJsp3" method="post"
action="/tomahawk_tags/pages/htmlTag.jsf"
enctype="application/x-www-form-urlencoded">
<h1>t:htmlTag Example</h1>
<b><i>Bold & Italic font</i></b>
<br />
Bold property will not be applied here.
<input type="hidden" name="_idJsp3_SUBMIT" value="1" />
<input type="hidden" name="javax.faces.ViewState"
id="javax.faces.ViewState" value="rO0ABXVyABNbTGph
dmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgBHb3JnLmFwYWNoZS5
teWZhY2VzLmFwcGxpY2F0aW9uLlRyZWVTdHJ1Y3R1cmVNYW5hZ2VyJFRyZWVTdH
J1Y3RDb21wb25lbnRGWRfYnEr2zwIABFsACV9jaGlsZHJlbnQASltMb3JnL
............
............" />
</form>
</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 htmlTag tag
Post your Comment