3 Replies Latest reply on May 6, 2011 6:39 AM by wanderleimagri

    Problem with required and ajax render=@form

    wanderleimagri

      Good Morning,

       

      my page is as follows:

       

      <?xml version='1.0' encoding='ISO-8859-1' ?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns:h="http://java.sun.com/jsf/html"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j"

            >

          <h:head>

              <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

       

          </h:head>

          <h:body>

              <h:form >

                  RA: <h:inputText id="ra" value="#{managedBean.aluno.matricula}" />            

       

                  <br/>

                  Nome:  <h:inputText value="#{managedBean.aluno.pessoal.nome}"  />

                  <br/>

                  Mensagem  <h:inputText value="#{managedBean.mensagem.mensagem}" id="mensagem" required="true" requiredMessage="Campo Obrigatorio"  />

                  <br/>

                  <a4j:commandButton action="#{managedBean.consultaAluno}"  value="consultar" execute="@this ra" render="@form"/>

                  <a4j:commandButton action="#{managedBean.alterarMensagem}"  value="alterar" render="@form" />

                  <h:messages/>

       

              </h:form >

       

          </h:body>

      </html>

       

      I will explain step by step for you to understand:
      1 - I put a code in the field 'ra' and push the button '
      consultar' , it performs the correct action in ManagedBean and returns the object found me.
      2 - push the button 'alterar', it displays a message telling me that the field 'mensagem' is required, so far so good
      3 - This is where the problem occurs if I change the code in the field 'ra' and push the button 'consultar' it performs the action in ManagedBean but does not update the
      fields 'mensagem' and 'nome'.

      It's a bug in the jsf required or that I'm doing wrong?