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

发布于 2024-08-26 16:48:55 字数 1092 浏览 5 评论 0原文

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

<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 已更新并正确打印出来,但我的页面不会刷新并在需要时检查所有其他复选框。

I am having issues with JSF/ADF/PPR on refreshing the page incorrectly. I have a selectManyCheckBox with 5 options in it, one of the option is 'All'. If users check that checkbox, I should check all the others.

<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>

I am using valueChangeListener so that I can see my bean updated and printed out correctly, but my page does not refresh and check all the other checkbox if I need to.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

感情洁癖 2024-09-02 16:48:55

请尝试以下操作:

  1. 不要使用 valueChangeListener。将您的逻辑移至 bean 上的 setApplyChangesList() 方法。
  2. partialTriggers="changesCheckedBox" 添加到单选一项。
  3. 或者将 替换为 ADF 组件 &设置其 partialTriggers 属性,使其不在 selectManyCheckboxoutputText

或者

selectManyCheckbox 替换为 selectManyList &使用 selectAllVisible 属性似乎可以满足您的要求。

这些新的备忘单太棒了!
http://www.oracle.com/技术/产品/adf/adffaces/11/doc/cheatsheet/lovs.html

Try the following:

  1. Don't use the valueChangeListener. Move your logic to the setApplyChangesList() method on your bean.
  2. Add partialTriggers="changesCheckedBox" to the the select one choice.
  3. OR replace the <h:panelGrid/> with an ADF component & set the partialTriggers attribute on it so that it isn't on the selectManyCheckbox & outputText

OR

Replace the selectManyCheckbox with selectManyList & use the selectAllVisible attribute which seems to do what you want.

These new cheatsheets are great!
http://www.oracle.com/technology/products/adf/adffaces/11/doc/cheatsheet/lovs.html

月朦胧 2024-09-02 16:48:55

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

I know the question is very old, but maybe others still have this problem.
It's better to put the partialTrigger on the parent of the rather than on the output itself. This way, the parent panel is repainted, together with the output.
Secondly, it's a good idea to set the "id" field of the components that should respond to triggers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文