This tag is used to create the input text box in the page with the capability of disappearing or selecting the text displayed in the component for the help of the user. Text for the help is set to the helpText attribute and capability of disappearing or selecting the text is provided by selectText attribute of the tag. This tag has additional feature of displaying value only, not the widget of the box. This component also has ability to be visible or not visible according to the role of the user. In the same way, it also has the ability to be enable or disable according to the user role. This component also has the capability to render the id for the component just the same as we have mentioned in the id attribute of the tag. Normally the naming system of JSF renders the id for the component with some additional text, typically with id of the form as prefix. But this component has an attribute forceId which forces the component to render the same id mentioned in the id attribute.
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>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>t:inputTextHelp example</title>
<style type="text/css">
<!--
body{
background-color:#fff2f2;
margin-top:30;
}
.inputstyle{
background-color:#99CCFF;
}
-->
</style>
</head>
<body ><center>
<t:inputTextHelp id="ith1" value="" helpText="Hello...." style="color:#0033CC; font-weight:bold" styleClass="inputstyle" title="inputTextHelp example 1" /><p> <t:inputTextHelp id="ith2" value="" helpText="How are you?" selectText="true" style="color:#0033CC; font-weight:bold" styleClass="inputstyle" title="inputTextHelp example 2" /> </center></body> </html> </f:view> |
Rendered Output :
This is the output of the page. In this Hello.... and How are you? texts are
the texts specified in the helpText attribute of the tag.

If we take focus on the first component then text in the component disappears while in the other whole text is selected because of setting the selectText attribute to true in the second component.

Html Source Code :
<html> <head> <script type="text/javascript" src="/tomahawk_tags/faces/myFacesExtensionResource/ org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/ 11846744/inputTextHelp.HtmlTextHelpRenderer/inputTextHelp.js"><!-- //--></script> <meta http-equiv="Content-Type" |
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 inputTextHelp tag View All Comments
Post your Comment