This tag is used to create the component which displays the list of languages in selection box according to the locale.
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:selectOneLanguage example</title>
<style type="text/css">
<!--
body{
background-color:#fff2f2;
margin-top:30;
}
-->
</style>
</head>
<body >
<h:form><center>
<t:panelGrid columns="2" style="font-weight:bold;">
<t:outputLabel for="name" value="Name" />
<t:inputText id="name"/>
<t:outputLabel for="phone" value="Phone 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 :

Html Source Code :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>t:selectOneLanguage example</title>
<style type="text/css">
<!--
body{
background-color:#fff2f2;
margin-top:30;
}
-->
</style>
</head>
<body >
<form id="_idJsp0" name="_idJsp0" method="post"
action="/tomahawk_tags/pages/selectOneLanguage.jsf"
enctype="application/x-www-form-urlencoded"><center>
<table style="font-weight:bold;">
<tbody>
<tr><td>
<label for="_idJsp0:name">Name</label>
</td><td>
<input id="_idJsp0:name" name="_idJsp0:name" type="text" value="" />
</td></tr>
<tr><td>
<label for="_idJsp0:phone">Phone No.</label>
</td><td>
<input id="_idJsp0:phone" name="_idJsp0:phone" type="text" value="" />
</td></tr>
<tr><td>
<label for="_idJsp0:country">Country</label>
</td><td>
<select id="_idJsp0:country" name="_idJsp0:country" size="1">
<option value="" selected="selected">Select Country</option>
<option value="AF">Afghanistan</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<option value="AG">Antigua and B...</option>
...................
...................
</select></td></tr>
<tr><td>
<label for="_idJsp0:language">Language</label>
</td><td>
<select id="_idJsp0:language" name="_idJsp0:language" size="1">
<option value="" selected="selected">Select Language</option>
<option value="ab">Abkhazian</option>
<option value="aa">Afar</option>
<option value="af">Afrikaans</option>
<option value="ak">Akan</option>
<option value="sq">Albanian</option>
<option value="am">Amharic</option>
<option value="ar">Arabic</option>
<option value="vo">Volapük</option>
................
................
</select></td></tr>
</tbody></table>
</center><input type="hidden" name="_idJsp0_SUBMIT" value="1" />
<input type="hidden" name="javax.faces.ViewState"
id="javax.faces.ViewState"
value="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AA
ExcHQAHC9wYWdlcy9zZWxlY3RPbmVMYW5ndWFnZS5qc3A=" /></form>
<!-- MYFACES JAVASCRIPT -->
</body>
</html>
|
This tag contains attributes given below :
|
Recommend the tutorial |
Ask Questions? Discuss: Tomahawk selectOneLanguage tag
Post your Comment