JSF selectBooleanCheckbox tag example
1). JSF selectBooleanCheckbox tag Program Structure:
2). index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<html>
<head>
<title>JSF selectBooleanCheckbox tag example!</title>
<script type="text/javascript">
function selectBooleanCheckbox(){
alert(document.getElementById('jsfselectBooleanCheckbox:chkRememberMe').checked);
}
</script>
</head>
<body>
<f:view>
<h1>JSF h:selectBooleanCheckbox tag </h1>
<h:form id="jsfselectBooleanCheckbox">
<h:selectBooleanCheckbox value="Remember Me" id="chkRememberMe" />
<h:commandButton value="Show Checked" onclick="selectBooleanCheckbox()" />
</h:form>
</f:view>
</body>
</html>
3). OutPut
No comments:
Post a Comment