如何使用 <h:commandButton> 更新 div 并进行部分提交,我以前用过<p:commandButton>通过将ajax属性设置为true并将更新属性设置为:statusBlock来做部分提交,其中<h:panelGroup>的id是状态块。我在 <p:commandButton> 上遇到了一些设计问题所以我不能使用它所以我必须使用 <h:commandButton> .
请您参考如下方法:
这是通过嵌套一个 <f:ajax> 来完成的。在里面。
在效果上,
<p:commandButton ... process="@form" update=":statusBlock" />
完全一样
<h:commandButton ...>
<f:ajax execute="@form" render=":statusBlock" />
</h:commandButton>
请注意,与 PrimeFaces 等效项的细微差别在于 PrimeFaces 默认为
@form在进程/执行中,而
<f:ajax>一个默认为
@this ,因此您可能需要明确指定
execute="@form"在所有没有指定
process 的地方PrimeFaces 组件中的属性。
也可以看看:




