primefaces单选按钮在jquery中保持“选中”
我将Primefaces 3.2与cupertino主题结合使用:primefaces单选按钮在jquery中保持“选中”,jquery,button,primefaces,radio,Jquery,Button,Primefaces,Radio,我将Primefaces 3.2与cupertino主题结合使用: <context-param> <param-name>primefaces.THEME</param-name> <param-value>cupertino</param-value> </context-param> 当我点击单选按钮时,它会被选中。。但是如果我尝试用jquery取消检查,它仍然处于检查状态。。我在底部链接中使用
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>cupertino</param-value>
</context-param>
当我点击单选按钮时,它会被选中。。但是如果我尝试用jquery取消检查,它仍然处于检查状态。。我在底部链接中使用了一个简单的javascript函数
在xhtml页面之后:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Custom Radio Test</title>
<script type="text/javascript">
function uncheckTest() {
var myRadio = $("#mF\\:vB\\:0\\:vBI\\:0\\:ITRadioGrp\\:0");
alert("RADIO : " + myRadio.get(0).id + " CHECKED :" + myRadio.is(':checked'));
myRadio.removeAttr("checked");
myRadio.prop('checked', false);
alert("RADIO : " + myRadio.get(0).id + " CHECKED :" + myRadio.is(':checked'));
}
</script>
</h:head>
<h:body>
<h:form id="mF" >
<div>
<ui:repeat id="vB" value="#{testBean.groupOfVB}" var="aViewBoxPrice" varStatus="vbpindex" >
<ui:repeat id="vBI" value="#{testBean.groupOfIT}" var="aItinerary" varStatus="itiindex" >
#{itiindex.index + 1}° group
<p:selectOneRadio value="#{testBean.radioSelectedValue}" id="ITRadioGrp" layout="custom" >
<f:selectItems value="#{testBean.selectItems}" />
</p:selectOneRadio>
<ui:repeat id="vBGOF" value="#{testBean.groupOfFlights}" var="aFlight" varStatus="gofIndex">
<p:radioButton for=":mF:vB:vBI:ITRadioGrp" itemIndex="#{gofIndex.index}"/> #{aFlight}
<br />
</ui:repeat>
<br />
</ui:repeat>
<br />
</ui:repeat>
<a href="javascript:uncheckTest()">UNCHECK</a>
</div>
</h:form>
</h:body>
</html>
我不明白为什么。。
谢谢 这是因为PrimeFacesCSS。。我不得不用jquery取消选中收音机