我正在使用 primefacesselectoneradio
控件,它将显示或隐藏panelgrid
之后的选择。但不知道为什么它不能panelgrid
在选择 allTeachers 广播时隐藏它。
public boolean getVisibleTeacherList() {
if (this.selectedAllTeachersFlag == "AllTeachers")
return false;
else
return true;
}
<p:panelGrid columns="2">
<p:selectOneRadio id="console" value="#{chkTeacherList.selectedAllTeachersFlag}">
<f:selectItem itemLabel="All teachers" itemValue="AllTeachers" />
<f:selectItem itemLabel="Selected teachers" itemValue="SelectedTeachers" />
<p:ajax update="panelGrid1a1" />
</p:selectOneRadio>
</p:panelGrid>
<p:panelGrid id="panelGrid1a1" rendered="#{chkTeacherList.getVisibleTeacherList()}" columns="1" styleClass="ui-edb-noneborder-grid">
<p:separator style="border: 1px solid #8c4eea;" />
<p:panelGrid id="panelGrid1" columns="3" styleClass="ui-edb-noneborder-grid">
<p:selectManyCheckbox layout="grid" id="gridTeacherName" value="#{chkTeacherList.selectedValue}"
columns="3">
<f:selectItems value="#{chkTeacherList.filterTeacherNameList}" var="teacher" itemLabel="#{teacher.teacherEngName}" itemValue="#{teacher.timRefNo}" />
</p:selectManyCheckbox>
</p:panelGrid>
<p:separator style="border: 1px solid #8c4eea;" />
</p:panelGrid>