5 Replies Latest reply on Feb 16, 2009 1:02 PM by Nick Belaevski

    a4j:form not submitting h:inputText value

    Carlos Diógenes Newbie

      Hi,

      I have the following page:

      <f:subview xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:s="http://jboss.com/products/seam/taglib">
      
       <rich:modalPanel id="modificarChefiaImediata" width="600" height="500" >
       <f:facet name="header">
       <h:panelGroup>
       <h:outputText value="Alterar chefia imediata"></h:outputText>
       </h:panelGroup>
       </f:facet>
       <f:facet name="controls">
       <h:panelGroup>
       <h:graphicImage value="/img/icons/close.png" style="cursor:pointer" id="hidelink"/>
       <rich:componentControl for="modificarChefiaImediata" attachTo="hidelink" operation="hide" event="onclick"/>
       </h:panelGroup>
       </f:facet>
      
       <a4j:form ajaxSubmit="true" id="pssFisicaSearch" styleClass="edit" reRender="valorBusca">
       <h:inputText id="valorBusca" value="#{bscPssFsc.valorBusca}" />
      
       <div class="actionButtons">
       <h:commandButton id="search" value="Procurar" action="#{bscPssFsc.aplicarConsulta()}" />
       </div>
       </a4j:form>
      
       <rich:panel id="resultadosBusca">
       <f:facet name="header">Resultados da busca</f:facet>
       <div class="results" id="pssFisicaList">
       <rich:dataTable id="pssFisicaList"
       var="pssFisica"
       value="#{pssFisicaList.resultList}"
       rendered="#{not empty pssFisicaList.resultList}">
       <h:column>
       <f:facet name="header">
       <a4j:commandLink styleClass="columnHeader"
       value="Código #{pssFisicaList.order=='pssFscCodigo asc' ? messages.down : ( pssFisicaList.order=='pssFscCodigo desc' ? messages.up : '' )}"
       action="#{pssFisicaList.setOrder(pssFisicaList.order=='pssFscCodigo asc' ? 'pssFscCodigo desc' : 'pssFscCodigo asc')}"
       reRender="resultadosBusca,controles" />
       </f:facet>
       #{pssFisica.pssFscCodigo}
       </h:column>
       <h:column>
       <f:facet name="header">
       <a4j:commandLink styleClass="columnHeader"
       value="Nome #{pssFisicaList.order=='pssFscNome asc' ? messages.down : ( pssFisicaList.order=='pssFscNome desc' ? messages.up : '' )}"
       action="#{pssFisicaList.setOrder(pssFisicaList.order=='pssFscNome asc' ? 'pssFscNome desc' : 'pssFscNome asc')}"
       reRender="resultadosBusca,controles" />
       </f:facet>
       #{pssFisica.pssFscNome}
       </h:column>
       <h:column>
       <f:facet name="header">Ação</f:facet>
       <s:link action="#{avlEtapaHome.alterarChefe(avlPssFscEtapa.avlEtapa, pssFisica)}"
       value="Selecionar"
       id="pssFisicaLink"/>
       </h:column>
       </rich:dataTable>
       </div>
       </rich:panel>
      
       <a4j:outputPanel id="controles">
       <a4j:region>
       <div class="tableControl">
       <a4j:commandLink rendered="#{pssFisicaList.previousExists}"
       value="#{messages.left}#{messages.left} Primeira Página"
       action="#{pssFisicaList.setFirstResult(0)}"
       reRender="resultadosBusca,controles"
       id="firstPage"/>
      
       <a4j:commandLink rendered="#{pssFisicaList.previousExists}"
       value="#{messages.left} Página Anterior"
       action="#{pssFisicaList.setFirstResult(pssFisicaList.previousFirstResult)}"
       reRender="resultadosBusca,controles"
       id="previousPage"/>
      
       <a4j:commandLink rendered="#{pssFisicaList.nextExists}"
       value="Próxima Página #{messages.right}"
       action="#{pssFisicaList.setFirstResult(pssFisicaList.nextFirstResult)}"
       reRender="resultadosBusca,controles"
       id="nextPage"/>
      
       <a4j:commandLink rendered="#{pssFisicaList.nextExists}"
       value="Última Página #{messages.right}#{messages.right}"
       action="#{pssFisicaList.setFirstResult(pssFisicaList.lastFirstResult)}"
       reRender="resultadosBusca,controles"
       id="lastPage"/>
       </div>
       </a4j:region>
       </a4j:outputPanel>
       </rich:modalPanel>
      
       <div align="center">
       <h:form>
       <a4j:commandLink value="Alterar Chefia" id="link">
       <rich:componentControl for="modificarChefiaImediata" attachTo="link" operation="show" event="onclick"/>
       </a4j:commandLink>
       </h:form>
       </div>
      
      </f:subview>
      


      The method "aplicarConsulta" in "bscPssFisica" is called correclty, but the inputText is no submitted. This is the expected behaviour? Or I'm doing something wrong.

      I'm using JBoss 4.2.3.GA, Seam 2.0.1 and RichFaces 3.2.2.

      Thanks
      Carlos.

        • 1. Re: a4j:form not submitting h:inputText value
          Nick Belaevski Master

          Hello Carlos,

          I've checked this:

          <a4j:form ajaxSubmit="true" id="pssFisicaSearch" styleClass="edit" reRender="valorBusca">
           <h:inputText id="valorBusca" value="#{bscPssFsc.valorBusca}" />
          
           <div class="actionButtons">
           <h:commandButton id="search" value="Procurar" action="#{bscPssFsc.aplicarConsulta()}" />
           </div>
           </a4j:form>
          with 3.3.0.GA, works fine.

          • 2. Re: a4j:form not submitting h:inputText value
            Carlos Diógenes Newbie

            It's also works with 3.2.2. I guess that the problem was that I'm was inserting this f:subview in each row of a rich:dataTable with ui:include.

            I inserted the rich:modalPanel direclty in the page where I was using it and call it throw it's javascript api and it's worked fine.

            This is a bug or a expected behaviour?

            Thanks,
            Carlos.

            • 3. Re: a4j:form not submitting h:inputText value
              Nick Belaevski Master

              Carlos,

              Please post full source of including page.

              • 4. Re: a4j:form not submitting h:inputText value
                Carlos Diógenes Newbie

                Hi,

                This is the full source of the including page:

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:rich="http://richfaces.org/rich"
                 xmlns:s="http://jboss.com/products/seam/taglib">
                
                 <ui:composition template="../layout/template.xhtml">
                
                 <ui:define name="body">
                
                 <rich:dataTable id="dtrChfImediataList"
                 var="avlPssFscEtapa"
                 value="#{dtrChfImediataList.resultList}"
                 rendered="#{not empty dtrChfImediataList.resultList}">
                 <h:column>
                 <f:facet name="header">
                 <s:link styleClass="columnHeader"
                 value="Código do Avaliado #{dtrChfImediataList.order=='pssFisica.pssFscCodigo asc' ? messages.down : ( dtrChfImediataList.order=='pssFisica.pssFscCodigo desc' ? messages.up : '' )}">
                 <f:param name="order" value="#{dtrChfImediataList.order=='pssFisica.pssFscCodigo asc' ? 'pssFisica.pssFscCodigo desc' : 'pssFisica.pssFscCodigo asc'}"/>
                 </s:link>
                 </f:facet>
                 #{avlPssFscEtapa.pssFisica.pssFscCodigo}
                 </h:column>
                 <h:column>
                 <f:facet name="header">
                 <s:link styleClass="columnHeader"
                 value="Avaliado #{dtrChfImediataList.order=='pssFisica.pssFscNome asc' ? messages.down : ( dtrChfImediataList.order=='pssFisica.pssFscNome desc' ? messages.up : '' )}">
                 <f:param name="order" value="#{dtrChfImediataList.order=='pssFisica.pssFscNome asc' ? 'pssFisica.pssFscNome desc' : 'pssFisica.pssFscNome asc'}"/>
                 </s:link>
                 </f:facet>
                 #{avlPssFscEtapa.pssFisica.pssFscNome}
                 </h:column>
                 <h:column>
                 <f:facet name="header">
                 <s:link styleClass="columnHeader"
                 value="Chefia Imediata #{dtrChfImediataList.order=='pssFscChfImediata.pssFscNome asc' ? messages.down : ( dtrChfImediataList.order=='pssFscChfImediata.pssFscNome desc' ? messages.up : '' )}">
                 <f:param name="order" value="#{dtrChfImediataList.order=='pssFscChfImediata.pssFscNome asc' ? 'pssFscChfImediata.pssFscNome desc' : 'pssFscChfImediata.pssFscNome asc'}"/>
                 </s:link>
                 </f:facet>
                 #{avlPssFscEtapa.pssFscChfImediata.pssFscNome}
                 </h:column>
                 <h:column>
                 <f:facet name="header">Comandos</f:facet>
                 <ui:include src="/dialogos/modificarChefiaImediata.xhtml" />
                 </h:column>
                 </rich:dataTable>
                
                 </ui:define>
                
                 </ui:composition>
                
                </html>
                


                Best regards,
                Carlos.

                • 5. Re: a4j:form not submitting h:inputText value
                  Nick Belaevski Master

                  Hello,

                  The problem is caused by this issue: https://jira.jboss.org/jira/browse/RF-5773. Workaround:

                  <a4j:form ajaxSubmit="true" ajaxSingle="true" id="pssFisicaSearch" styleClass="edit" reRender="valorBusca">