3 Replies Latest reply on Jan 4, 2012 6:47 AM by cgv2000

    Form reset after upload by fileUpload

    Adson Damasceno Newbie

      Hi, i'm using RF4 and i have a popupanel with fileUpload. In popupPanel has inputtext also. When i upload anything the form is reseted. How to solve it?

       

          <rich:popupPanel modal="true" id="addPane" moveable="false" autosized="true">

              <f:facet name="header">

                  <h:outputText value="Adicionar Categoria" />

              </f:facet>

              <h:form>

                  <h:panelGrid id="addGrid" columns="1">

                      <a4j:outputPanel ajaxRendered="true">

                          <h:panelGrid columns="2">

                              <h:outputText value="Legenda" />

                              <h:inputText value="#{areaInterativa.novoNome}" />

                              <h:outputText value="Link" />

                              <h:inputText value="#{areaInterativa.novoLink}" />

                              <h:outputText value="Ordem" />

                              <h:inputText value="#{areaInterativa.novoOrdem}"/>            

                          </h:panelGrid>

                      </a4j:outputPanel>

                  </h:panelGrid>

                  <h:panelGrid columns="1">

                      <rich:fileUpload addLabel="Selecionar Imagem"

                                       acceptedTypes="png, jpg"

                                       data=""

                                       listHeight="30px"

                                       maxFilesQuantity="1"

                                       fileUploadListener="#{upload.listenerAI}"

                                       uploadLabel="Enviar"

                                       clearAllLabel="Remover"

                                       deleteLabel="Deletar"

                                       doneLabel="Enviado!"

                                       clearLabel="Remover">

                          <a4j:ajax event="uploadcomplete" listener="#{upload.atualizaNovaCategoria}"/>

                      </rich:fileUpload>

                  </h:panelGrid>

                  <a4j:commandButton value="Salvar" action="#{areaInterativa.adicionaCategoria}" render="tabela" execute="addPane" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('addPane')}.hide();" />

                  <a4j:commandButton value="Cancelar" onclick="#{rich:component('addPane')}.hide(); return false;" /> 

              </h:form>

           </rich:popupPanel>

       

       

      Thanks,

       

      Adson

        • 1. Re: Form reset after upload by fileUpload
          cgv2000 Newbie

          <rich:popupPanel modal="true" id="addPane" moveable="false" autosized="true">

                  <f:facet name="header">

                      <h:outputText value="Adicionar Categoria" />

                  </f:facet>

                  <h:form>

                      <h:panelGrid id="addGrid" columns="1">

                          <a4j:outputPanel id="miPanelito" ajaxRendered="false">

                              <h:panelGrid columns="2">

                                  <h:outputText value="Legenda" />

                                  <h:inputText value="#{areaInterativa.novoNome}" />

                                  <h:outputText value="Link" />

                                  <h:inputText value="#{areaInterativa.novoLink}" />

                                  <h:outputText value="Ordem" />

                                  <h:inputText value="#{areaInterativa.novoOrdem}"/>            

                              </h:panelGrid>

                          </a4j:outputPanel>

                      </h:panelGrid>

                      <h:panelGrid columns="1">

                          <rich:fileUpload addLabel="Selecionar Imagem"

                                           acceptedTypes="png, jpg"

                                           data=""

                                           listHeight="30px"

                                           maxFilesQuantity="1"

                                           fileUploadListener="#{upload.listenerAI}"

                                           uploadLabel="Enviar"

                                           clearAllLabel="Remover"

                                           deleteLabel="Deletar"

                                           doneLabel="Enviado!"

                                           clearLabel="Remover" render="@none">

                              <a4j:ajax event="uploadcomplete" listener="#{upload.atualizaNovaCategoria}" render="@none"/>

                          </rich:fileUpload>

                      </h:panelGrid>

                      <a4j:commandButton value="Salvar" action="#{areaInterativa.adicionaCategoria}" render="tabela" execute="addPane" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('addPane')}.hide();" />

                      <a4j:commandButton value="Cancelar" onclick="#{rich:component('addPane')}.hide(); return false;" /> 

                  </h:form>

               </rich:popupPanel>