JSF/ADF/PPR 无法按预期刷新页面
我在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请尝试以下操作:
valueChangeListener
。将您的逻辑移至 bean 上的setApplyChangesList()
方法。partialTriggers="changesCheckedBox"
添加到单选一项。
替换为 ADF 组件 &设置其partialTriggers
属性,使其不在selectManyCheckbox
上outputText
或者
将
selectManyCheckbox
替换为selectManyList
&使用selectAllVisible
属性似乎可以满足您的要求。这些新的备忘单太棒了!
http://www.oracle.com/技术/产品/adf/adffaces/11/doc/cheatsheet/lovs.html
Try the following:
valueChangeListener
. Move your logic to thesetApplyChangesList()
method on your bean.partialTriggers="changesCheckedBox"
to the the select one choice.<h:panelGrid/>
with an ADF component & set thepartialTriggers
attribute on it so that it isn't on theselectManyCheckbox
&outputText
OR
Replace the
selectManyCheckbox
withselectManyList
& use theselectAllVisible
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
我知道这个问题很老了,但也许其他人仍然有这个问题。
最好将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.