【问题标题】:JSF/ADF/PPR can't refresh the page as expectedJSF/ADF/PPR 无法按预期刷新页面
【发布时间】:2010-03-26 17:40:26
【问题描述】:

我在不正确地刷新页面时遇到 JSF/ADF/PPR 问题。我有一个带有 5 个选项的 selectManyCheckBox,其中一个选项是“全部”。如果用户选中该复选框,我应该检查所有其他复选框。

<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 已正确更新并打印出来,但我的页面没有刷新,如果需要,请选中所有其他复选框。

【问题讨论】:

    标签: jsf oracle-adf trinidad


    【解决方案1】:

    尝试以下方法:

    1. 不要使用valueChangeListener。将您的逻辑移至 bean 上的 setApplyChangesList() 方法。
    2. partialTriggers="changesCheckedBox" 添加到选择一个选项中。
    3. 或将&lt;h:panelGrid/&gt; 替换为ADF 组件并在其上设置partialTriggers 属性,使其不在selectManyCheckboxoutputText

    selectManyCheckbox 替换为selectManyList 并使用selectAllVisible 属性,这似乎可以满足您的需求。

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

    【讨论】:

      【解决方案2】:

      我知道这个问题很老了,但也许其他人仍然有这个问题。 最好将 partialTrigger 放在父级而不是输出本身。这样,父面板与输出一起被重新绘制。 其次,最好设置应该响应触发器的组件的“id”字段。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-08-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-06-21
        相关资源
        最近更新 更多