Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 使用<;p:ajax>;在JSF中,UIRepeat防止呈现组件_Jsf 2_Primefaces - Fatal编程技术网

Jsf 2 使用<;p:ajax>;在JSF中,UIRepeat防止呈现组件

Jsf 2 使用<;p:ajax>;在JSF中,UIRepeat防止呈现组件,jsf-2,primefaces,Jsf 2,Primefaces,我有一个jsf,我想在这里显示一个复选框列表。如果我像下面的示例中那样创建它,复选框将正确呈现 <p:outputPanel layout="block" rendered="#{scheduleConfigBean.selectedMonthType == 1}" style="width: 400px; margin-top: 45px"> <ui:repeat var="monthDay" value="#{scheduleConfigBean.monthDays}"

我有一个jsf,我想在这里显示一个复选框列表。如果我像下面的示例中那样创建它,复选框将正确呈现

<p:outputPanel layout="block" rendered="#{scheduleConfigBean.selectedMonthType == 1}" style="width: 400px; margin-top: 45px">
  <ui:repeat var="monthDay" value="#{scheduleConfigBean.monthDays}">
    <p:selectBooleanCheckbox value="#{monthDay.checked}" />
    <h:outputText value="#{monthDay.name}" />
  </ui:repeat>
</p:outputPanel>

但是,当我向每个复选框添加ajax事件侦听器时,面板将不再呈现。我这里有什么问题

<p:outputPanel layout="block" rendered="#{scheduleConfigBean.selectedMonthType == 1}" style="width: 400px; margin-top: 45px">
  <ui:repeat var="monthDay" value="#{scheduleConfigBean.monthDays}">
    <p:selectBooleanCheckbox value="#{monthDay.checked}">
      <p:ajax listener="#{scheduleConfigBean.updateMonthlyButtonState}" update="saveBtn" />
    </p:selectBooleanCheckbox>
    <h:outputText value="#{monthDay.name}" />
  </ui:repeat>
</p:outputPanel>


多亏了达卡,他的回答给了我答案

<p:outputPanel layout="block" rendered="#{scheduleCreate.selectedMonthType == 1}" style="width: 500px; margin-top: 45px">
  <c:forEach items="#{scheduleCreate.monthDays}" var="monthDay" varStatus="status">
    <p:selectBooleanCheckbox value="#{monthDay.checked}" style="margin-left: 8px">
      <p:ajax listener="#{scheduleCreate.updateButton}" update="saveBtn" />
    </p:selectBooleanCheckbox>
  </c:forEach>
</p:outputPanel>

我想我的朋友应该帮助你