以下代码适用于PF 3.2但是当我切换到3.4时,SelectOneRadio值始终为null?我已经尝试将事件作为change和valueChange而不是默认点击,所有结果都是相同的值= null。在FF中工作,如果p:ajax更新为“main”,则IE8会将setComp方法的两次空值都命中为p:panelGrid
<p:panelGrid id="main" columns="1" styleClass="Grid">
<p:selectOneRadio id="newold" value="#{newmailer.selectedCompStatus}" >
<f:selectItems value="#{newmailer.options}" />
<p:ajax listener="#{newmailer.setComp}" update="main" />
</p:selectOneRadio>
</p:panelGrid>
private List<SelectItem> options;
public NewMailerBean(){
super();
images = new ArrayList<byte []>();
imagesNames = new ArrayList<String>();
options = new ArrayList<SelectItem>();
SelectItem option = new SelectItem("exist", "Existing Company", "This is for selectItems tag");
options.add(option);
option = new SelectItem("new", "New Company");
options.add(option);
}
public void setComp(AjaxBehaviorEvent event) {
String str = this.selectedCompStatus;
try {
if(str.equals("exist")){
setExist(true);
setShowInfo(true);
}else{
setExist(false);
setShowInfo(true);
}