1 Reply Latest reply on Aug 9, 2007 4:19 AM by Ilya Shaikovsky

    Error - Forms

    Augusto Dias Newbie

      Hi, I have this code:

      <h:form prependId="true" id="form">
       <label for="finstituicao">Nome da Instituição:</label>
       <h:inputText id="finstituicao"
       value="#{instituicaoController.instituicao.nome}"
       onkeypress="return entsub(event)" />
       <a4j:commandButton value="Procurar" id="search"
       action="#{instituicaoController.findInstituicoes }"
       reRender="tinstituicoes" />
       <h:dataTable id="tinstituicoes"
       value="#{instituicaoController.instituicoes}" var="instituicaov" summary="Instituições">
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{instituicaoController.nome}" />
       </f:facet>
       <h:outputText value="#{instituicaov.nome}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="#{instituicaoController.sigla}" />
       </f:facet>
       <h:outputText value="#{instituicaov.sigla}" />
       </h:column>
       <h:column>
       <a4j:commandLink reRender="instituicao" value="Selecionar"
       oncomplete="windowClose('paneli')">
       <f:setPropertyActionListener
       target="#{instituicaoController.instituicao}"
       value="#{instituicaov}" />
       </a4j:commandLink>
       </h:column>
       </h:dataTable>
       <h:outputLink value="javascript:Richfaces.showModalPanel('ninstituicao')">Cadastrar Nova</h:outputLink>
      </h:form>

      The commandLinks in the dataTable don't work. They don't call any method that I put in the action attribute.
      If I remove the commandButton and inputText and populate the list for the dataTable, the commandLinks works perfectly, but I need this to perform searchs.
      I think this error occurs because the form is submited more times, then I need a way to reRender the dataTable when the user input a text to search without submit. I tried to separate the commandLink and commandButton in differente forms, but don't work.

      Thanks...