4 Replies Latest reply on Jan 13, 2012 1:50 PM by godoy

    Custom component does not send data form [SatangosDeletePanel]

    godoy

      I created a custom component for deletion of data, but when I click the delete button does not arrow component data of a field h: inputTextarea in my bean which can be so all the help and welcome.

       

       

      <ui:define name="conteudo">

              <h:form id="categoriaForm" binding="#{categoriaMBean.form}">

              <a4j:keepAlive beanName="categoriaMBean" />

                  <h1>Categorias</h1>

      ...

       

      <rich:dataTable id="categoriaTb" value="#{categoriaMBean.model}"

                      var="item" rows="10" align="center" width="80%">

      ...

       

      <rich:column width="40px">

                          <f:facet name="header">

                              <h:outputText value="Ações" />

                          </f:facet>

                          <a4j:commandLink actionListener="#{categoriaMBean.actionEdit}"

                              id="qpoedit" reRender="categoriaModalForm" ajaxSingle="true"

                              immediate="true"

                              oncomplete="Richfaces.showModalPanel('categoriaModalInclude')">

                              <h:graphicImage value="/images/_edit.gif" />

                          </a4j:commandLink>

       

                          <sanepar:satangossDeletePanel page="/pages/motivoPanel.xhtml"

                              mBean="#{categoriaMBean}" reRender="categoriaTb"

                              actionExcluir="actionDelete" confirmId="categoriaDeletePanel"

                              msg="Deseja excluir a categoria '#{item.id}' ?" />

                             

                             

                      </rich:column>

       

      ...

       

       

      The satangos Component

       

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

      <ui:composition 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:c="http://java.sun.com/jstl/core">

       

          <a4j:loadScript src="/js/scripts.js" />

       

          <c:if test="#{empty actionExcluir}">

              <c:set var="actionExcluir" value="actionExcluir"></c:set>

          </c:if>

          <c:if test="#{empty confirmId}">

              <c:set var="confirmId" value="defaultConfirmId"></c:set>

          </c:if>

          <c:if test="#{empty disabled}">

              <c:set var="disable" value="false"></c:set>

          </c:if>

          <c:if test="#{empty msg}">

              <c:set var="msg" value="Deseja excluir o item?"></c:set>

          </c:if>

          <c:if test="#{empty rendered}">

              <c:set var="rendered" value="true"></c:set>

          </c:if>

         

         

          <c:set var="otherBean" value="#{mBean}"></c:set>

          <c:if test="#{empty actionPrepareData}">

              <c:set var="actionPrepareData" value="addNullActionlistener"></c:set>

              <c:set var="otherBean" value="#{mBean}"></c:set>

          </c:if>

       

          <a4j:commandButton

              oncomplete="#{rich:component(sanepar:concat(confirmId,'confirmation'))}.show();return false"

              ajaxSingle="true" image="/images/_del.gif" immediate="true" disabled="#{disabled}"

              rendered="#{rendered}"    style="border: none;"  actionListener="#{otherBean[actionPrepareData]}">

          </a4j:commandButton>

         

       

          <rich:modalPanel id="#{confirmId}confirmation"  autosized="false"

          >

              <f:facet name="header">

                  <h:outputText value="Confirmação" />

              </f:facet>

              <f:facet name="controls">

                  <h:panelGroup>

                      <h:graphicImage value="/images/close.png" id="#{confirmId}link" />

                      <rich:componentControl for="#{confirmId}confirmation"

                          attachTo="#{confirmId}link" operation="hide" event="onclick" />

                  </h:panelGroup>

              </f:facet>   

              <div id="deletePanel">           

                  <p><h:outputText value="#{msg}"/></p>

                  <c:if test="#{not empty page}">

                      <ui:include src="#{page}" />

                  </c:if>

                  <div id="btns">

                      <h:commandButton  

                          value="Sim" styleClass="btn" >

                          <a4j:support event="onclick" actionListener="#{mBean[actionExcluir]}"

                           oncomplete="closeSatangosDeletePanel('#{confirmId}');" />

                      </h:commandButton>   

                              

                      <input type="button" value="Não" class="btn"

                          onclick="#{rich:component(sanepar:concat(confirmId,'confirmation'))}.hide();return false" />

                  </div>

              </div>

          </rich:modalPanel>

       

      </ui:composition>

       

       

      The page included by <ui:include in modal Satangos

       

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

      <ui:composition 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">

             

              <h5>Motivo:</h5>

              <h:inputTextarea value="#{categoriaMBean.motivoExclusao}" rows="6"

              id="motivoBox"  />

         

      </ui:composition>

       

      please help me team.

      Thanks