This tag renders an html "input" tag
whose type is set to "checkbox" . If the "value" of
this component is set to "true" then a checked checkbox is
rendered. This is used when we want to give an option to the user to
select or deselect.
Code Description : In this code, the index attribute is to identify the
item to select for display.
<%@ 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:selectBooleanCheckbox example</title>
<style type="text/css">
<!--
body{
background-color:#fff2f2;
margin-top:30;
}
-->
</style>
</head>
<body >
<h:form><center>
<t:panelGrid columns="2">
<t:selectBooleanCheckbox
id="checkbox1" value="true"
title="click to select or deselect" />
<t:outputText value="Show my b'day."/>
<t:selectBooleanCheckbox
id="checkbox2" value="true"
title="click to select or deselect"/>
<t:outputText value="Show my email id."/>
<t:selectBooleanCheckbox
id="checkbox3"
title="click to select or deselect"/>
<t:outputText value="Show my professional profile."/>
</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:selectBooleanCheckbox 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/selectBooleanCheckbox.jsf"
enctype="application/x-www-form-urlencoded"><center>
<table><tbody><tr><td>
<input type="checkbox" name="_idJsp0:checkbox1"
id="_idJsp0:checkbox1" checked="checked"
value="true" title="click to select or deselect" /></td>
<td>Show my b'day.</td></tr>
<tr><td><input type="checkbox" name="_idJsp0:checkbox2"
id="_idJsp0:checkbox2" checked="checked" value="true"
title="click to select or deselect" /></td>
<td>Show my email id.</td></tr>
<tr><td><input type="checkbox" name="_idJsp0:checkbox3"
id="_idJsp0:checkbox3" value="true"
title="click to select or deselect" /></td>
<td>Show my professional profile.</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="rO0ABXVyABNbTGphdmEubGFuZy5PYmplY3
Q7kM5YnxBzKWwCAAB4cAAAAAN0AAE0cHQAIC9wYWdlcy9zZWxlY3RCb29sZWFuQ2hlY2
tib3guanNw" /></form>
<!-- MYFACES JAVASCRIPT -->
</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 selectBooleanCheckbox tag
Post your Comment