Component Not Rendered By Ajax

Asked

Viewed 99 times

0

I have a form, where internally has a component h message: and a h:inputText, and I am submitting this form by jsf standard ajax... the problem is... when submitting the form ajax does not update the components it should update in the attribute surrender.

Something that happened was, when I removed the attribute execute of the component ajax works perfectly, but the form is not submitted, then has the code:

<h:form id="questoes_form">
<h:panelGroup id="panel_tabela">
    <h:dataTable  id="table_questoes" binding="#
 {questoesCPA.questoesDataTable}" value="#{questoesCPA.questoesList}" 
var="questao" styleClass="table responsive-table table-striped table-hover">

        <h:column>                                
            <f:facet name="header" >
                <h:selectBooleanCheckbox id="selecionarTodos" value="#{questoesCPA.todosSelecionados}" valueChangeListener="#{questoesCPA.selecionadorTodos}" class="checkbox pull-right">
                    <f:ajax execute="selecionarTodos" render="tableQuestoes"/>
                </h:selectBooleanCheckbox></f:facet>

            <h:selectBooleanCheckbox id="sleci" value="#{questao.selecionado}" valueChangeListener="#{questoesCPA.selecionar}" class="checkbox pull-right">
                <f:ajax execute="sleci" render="tableQuestoes"/>
            </h:selectBooleanCheckbox>

        </h:column>
        <h:column>                             
            <f:facet name="header" >Código</f:facet>
            QCPA#{questao.queId}CX
        </h:column>

        <h:column>                             
            <f:facet name="header" >Data e Horário da Criação</f:facet>
                #{questao.queDataCriacao}
        </h:column>
        <h:column>
            <f:facet name="header" >Tipo</f:facet>
                #{questao.queTipoQuestao}
        </h:column>
        <h:column>
            <f:facet name="header" >Ação</f:facet>
            <h:commandLink value=" " class="btn btn-default fa fa-pencil" title="Editar" ></h:commandLink>
            <h:commandLink value=" " class="btn btn-default fa fa-trash" style="margin-left: 0.25em;" title="Deletar"></h:commandLink>
            <h:commandLink value=" " class="btn btn-default fa fa-eye" style="margin-left: 0.25em;" title="Respostas"></h:commandLink>
        </h:column>
    </h:dataTable>
</h:panelGroup>
</h:form>

    <h:form id="questoes_subjetivas_form">
        <div class="panel panel-primary">
            <div class="panel-heading">Questão Subjetiva</div>
            <div class="panel-body">

                <div class="row">
                    <div class="col-md-12">
                        <div class="row">
                            <div class="col-md-12">
                                <label>Enunciado<span class="text-danger bold">*</span></label>                                                    
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="col-md-6">                                                
                                    <h:inputText id="enunciado_subjetiva" value="#{questaoSubjetivaCPA.questaoSubjetivaCPA.queEnunciado}" required="true" requiredMessage="Este Campo é de Preenchimento Obrigatório" label="Enunciado da Questão" pt:placeholder="Enunciado da Questão" class="form-control"/>
                                    <h:message for="enunciado_subjetiva" class="text-danger row">
                                    </h:message>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-md-8" >

                    <h:commandButton value="Salvar" class="btn btn-primary" action="#{questaoSubjetivaCPA.salvarQuestao}">
                        <f:ajax  render="@form :message_request :questoes_form:panel_tabela"  execute=" @form" >                                                        
                                                </f:ajax>


                    </h:commandButton>

                    <h:commandButton type="reset"  value="Limpar" class="btn btn-danger" style="margin-left: 0.6em;">                                                    

                    </h:commandButton>
                </div>

            </div>
        </div>
    </h:form>

</div>
  • On your button save which components really need to be updated ?

  • The form itself, a message containing the action response and a table containing the data that was saved.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.