Magazine
 
Tomahawk Tags
 

No.” />
<t:inputText id=”phone”/>
<t:outputLabel for=”country”
value=”Country” />
<t:selectOneCountry id=”country”
maxLength=”16"
emptySelection=”Select Country”/>
<t:outputLabel for=”language”
value=”Language” />
<t:selectOneLanguage id=”language”
maxLength=”16"
emptySelection=”Select Language”/>
</t:panelGrid>
</center>
</h:form>
</body>
</html>
</f:view>

Rendered Output:

4-Tomahawk validateEmail tag

This tag validates the email address entered in the field. We can render the validation message using message, detailMessage and summaryMessage attributes.

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:validateEmail example</title>
<style type=”text/css”>
<!—
body{
background-color:#fff2f2;
margin-top:30;
}
—>
</style>
</head>
<body >
<h:form><center>
<t:panelGrid columns=”2" style=”fontweight:
bold;” width=”40%”>
<t:outputText value=”Name” />
<t:inputText id=”name”/>
<t:outputText value=”Phone No.” />
<t:inputText id=”phone”/>
<t:outputText value=”Email” />
<t:panelGroup>
<t:inputText id=”email” required=”true”>
<t:validateEmail message=”Enter valid
EmailID.”/>
</t:inputText>
<f:verbatim></br></f:verbatim>
<t:message for=”email”/>
</t:panelGroup>
<t:outputText value=” “ />
<t:commandButton id=”cb” image=”images/
submit_button.gif” action=”welcome”/>
</t:panelGrid>
</center>
</h:form>
</body>
</html>
</f:view>

Rendered Output:

Oct 2007 | Java Jazz Up |37
 
previous
index
next
 
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 , 70, 71, 72, 73, 74, 75, 76, 77, 78,   Download PDF