使用h:commandButton进行Ajax更新和提交
如何使用使用h:commandButton进行Ajax更新和提交,ajax,jsf,jsf-2,primefaces,Ajax,Jsf,Jsf 2,Primefaces,如何使用更新div并进行部分提交,我以前使用过通过将ajax属性设置为true,将update属性设置为:statusBlock来进行部分提交,其中的id为statusBlock。我在中遇到一些设计问题,因此我无法使用它,因此我必须使用这是通过在其中嵌套a来完成的 实际上, <p:commandButton ... process="@form" update=":statusBlock" /> 与之完全相同 <h:commandB
更新div并进行部分提交,我以前使用过
通过将ajax属性设置为true,将update属性设置为:statusBlock来进行部分提交,其中
的id为statusBlock。我在
中遇到一些设计问题,因此我无法使用它,因此我必须使用
这是通过在其中嵌套a来完成的
实际上,
<p:commandButton ... process="@form" update=":statusBlock" />
与之完全相同
<h:commandButton ...>
<f:ajax execute="@form" render=":statusBlock" />
</h:commandButton>
请注意,与PrimeFaces等价物的细微区别在于PrimeFaces在进程/执行中默认为@form
,而
默认为@this
,因此您可能需要显式指定execute=“@form”
在PrimeFaces组件中未指定过程属性的所有位置
另见:
您可以将标准组件与f:ajax一起使用,例如
<h:form id="myForm">
<h:commandButton value="Push Me">
<f:ajax execute="myForm" render="statusBlock" />
</h:commandButton>
<h:panelGroup id="statusBlock">
</h:panelGroup>
</h:form>
执行和处理属性在h:commandButton中的作用是什么?
的作用与
完全相同。
的功能与
完全相同。这些属性只是指定表单提交期间需要执行/处理哪些组件(默认情况下,PrimeFaces为整个表单,标准JSF为当前组件)。