如何刷新表单中的所有字段?

How to refresh all fields in a form?

我试图在单击复选框时刷新表单中的所有字段:

            <h:selectBooleanCheckbox id="#{id}" 
                styleClass="checkbox"
                value="#{value}"
                required="#{required}" 
                disabled="#{not empty readonly and readonly ? true : disabled}"                
                onclick="showLoading();" >
                <a4j:support event="onchange" reRender="pessoaDocumentoIdentificacaoForm" oncomplete="hideLoading();" />
            </h:selectBooleanCheckbox>

问题是 pessoaDocumentoIdentificacaoForm,它是 JBoss 接缝。此表单中的所有字段均已刷新,但在 tipoDocumento 值...

中声明的除外
<components xmlns="http://jboss.com/products/seam/components"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
        http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
        http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">

<component name="pessoaDocumentoForm" class="br.com.itx.component.Form">
            <property name="formId">pessoaDocumentoIdentificacao</property>
            <property name="fields">
            <value>nome:{required:true,type: inputTextDocumentoIdentificacao, properties : {rendered: #{not justicaTrabalho},label: 'Nome registrado neste documento'}}</value>
                <value>tipoDocumento:{type: comboPessoaTipoDocumento, required: true,
                        properties:{items: #{preCadastroPessoaBean.isPermiteEdicaoDocumentosPrincipais() ? 'tipoDocumentoIdentificacaoItems' : 'tipoDocumentoIdentificacaoSemDocumentosPrincipaisItems'}}}</value>          
                <value>usadoFalsamente: {required: false, type: sim_nao, properties: {rendered: #{not justicaTrabalho}}}</value>        
                <value>documentoPrincipal: {type: checkBoxDocumentoPrincipal, properties: {rendered: #{not justicaTrabalho}}}</value>
                <value>ativo: {required: true, type: radioSituacao}</value>     
            </property>
            <property name="buttons">gravarDocumentoPessoa</property> 
        </component>
    </components>

...该决定的真实条件 (isPermiteEdicao) 重定向到 a4j 无法刷新的这些字段:

<component name="tipoDocumentoIdentificacaoItems" class="br.com.itx.component.SelectItemsQuery">
    <property name="ejbql">select o from TipoDocumentoIdentificacao o</property>

    <property name="restrictions">
        <value>o.tipoPessoa = #{pessoaDocumentoIdentificacaoHome.instance.pessoa.inTipoPessoa}</value>
        <value>o.tipoPessoa = #{pessoaHome.instance.inTipoPessoa}</value>
    </property>
    <property name="order">tipoDocumento</property>

下面我们可以看到结果:

明白了!

this issue 之后,我将 AjaxSingle="true" 添加到我的方法中,如下所示:

<a:support event="onchange" reRender="pessoaDocumentoIdentificacaoForm" oncomplete="hideLoading();" ajaxSingle="true" />