JSF / ADF / PPR无法按预期刷新页面

时间:2010-03-26 17:40:27

标签: jsf oracle-adf trinidad

我在刷新页面时遇到JSF / ADF / PPR问题。我有一个selectManyCheckBox,里面有5个选项,其中一个选项是'All'。如果用户选中该复选框,我应该检查所有其他复选框。

<h:panelGrid styleClass="myBox leftAligned" id="applyChangesBox">
            <af:selectManyCheckbox id="changesCheckedBox" 
                   autoSubmit="true" label="Hello: "
                   value="#{updateForm.applyChangesList}" 
                   valueChangeListener="#{updateForm.testValueChanged}">
              <af:selectItem value="A" label="All Changes"/>
              <af:selectItem value="R" label="Residential Address"/>
              <af:selectItem value="M" label="Mailing Address"/>
              <af:selectItem value="P" label="Personal Phone/Fax Numbers"/>
              <af:selectItem value="E" label="Personal Email Addresses"/>
            </af:selectManyCheckbox>
            <af:outputText value="#{updateForm.testValue}" partialTriggers="changesCheckedBox"/>
          </h:panelGrid>

我正在使用valueChangeListener,以便我可以看到我的bean更新并正确打印出来,但是如果需要,我的页面不会刷新并检查所有其他复选框。

2 个答案:

答案 0 :(得分:0)

尝试以下方法:

  1. 请勿使用valueChangeListener。将您的逻辑移动到bean上的setApplyChangesList()方法。
  2. partialTriggers="changesCheckedBox"添加到选择的一个选项中。
  3. 或者用ADF组件替换<h:panelGrid/>&amp;在其上设置partialTriggers属性,使其不在selectManyCheckbox&amp; outputText
  4. OR

    selectManyCheckbox替换为selectManyList&amp;使用似乎做你想做的selectAllVisible属性。

    这些新的备忘单很棒! http://www.oracle.com/technology/products/adf/adffaces/11/doc/cheatsheet/lovs.html

答案 1 :(得分:0)

我知道这个问题很老,但也许其他人仍然有这个问题。 将partialTrigger放在而不是输出本身的父节点上更好。这样,父面板与输出一起重新绘制。 其次,设置&#34; id&#34;是一个好主意。应该响应触发器的组件的字段。