Skip to content

Instantly share code, notes, and snippets.

@hatemalimam
Last active August 29, 2015 14:02
Show Gist options
  • Save hatemalimam/0de083b3038eeffb4dbf to your computer and use it in GitHub Desktop.
Save hatemalimam/0de083b3038eeffb4dbf to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<ui:composition template="/templates/default/main.xhtml">
<ui:define name="content">
<h:form>
<p:selectBooleanCheckbox widgetVar="selectWV"/>
<p:commandButton value="Register" widgetVar="buttonWV"/>
</h:form>
<script>
$(function() {
PF('buttonWV').disable();
PF('selectWV').jq.change(function() {
if (PF('selectWV').isChecked()) {
PF('buttonWV').enable();
} else {
PF('buttonWV').disable();
}
})
})
</script>
</ui:define>
</ui:composition>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment