阿贾克斯updation和提交使用H:的commandButton阿贾克斯、updation、commandButton

由网友(深藏功与名)分享简介:如何更新一个div并做使用部分提交< H:的commandButton> ,我有previously使用<电话号码: panelGroup中> 是statusBlock。我有&其中一些设计问题;号码:的commandButton> ,所以我不能用它,所以我必须使用< H:的comma...

如何更新一个div并做使用部分提交< H:的commandButton> ,我有previously使用<电话号码: panelGroup中> 是statusBlock。我有&其中一些设计问题;号码:的commandButton> ,所以我不能用它,所以我必须使用< H:的commandButton>

How to update a div and do partial submission using <h:commandButton>, I have previously used <p:commandButton> to do partial submission by setting the ajax attribute to true and the update attribute to :statusBlock, where the id of the <h:panelGroup> is statusBlock. I am having some designing issues with <p:commandButton> so I cannot use it so I have to use <h:commandButton>.

推荐答案

这是要由筑巢做了<f:ajax>在其中。

This is to be done by nesting a <f:ajax> in it.

在影响,

<p:commandButton ... process="@form" update=":statusBlock" />

不完全一样

<h:commandButton ...>
    <f:ajax execute="@form" render=":statusBlock" />
</h:commandButton>

请注意,与PrimeFaces相当于细微的不同之处在于PrimeFaces默认为 @form 在这个过程中/执行,而&LT; F: AJAX&GT; 一个默认为 @this ,所以你可能需要明确指定执行=@表过,你没有指定在PrimeFaces组件的过程属性的所有地方。

Note that the subtle difference with the PrimeFaces equivalent is that PrimeFaces defaults to @form in the process/execute, while the <f:ajax> one defaults to @this, so you might need to explicitly specify execute="@form" over all place where you didn't specify the process attribute in the PrimeFaces component.

通讯在JSF 2.0 - AJAX(异步)POST表单