3 Replies Latest reply on Dec 30, 2010 11:45 AM by godoy

    problems with TogglePanel 2

    godoy

      I'm having problems with (togglePanel)'ve checked the documentation but could not find a strategy that solves my problem.
      In my TooglePanel have 6 forms, I'll post my code aki, I would like help choosing the best strategy for my case.

       

      My togglePanel:

       

      <h:form id="formToogle">
      <Rich: togglePanel switchType = "ajax" id = "togglePanel1"
      stateOrder = "CAD1, CAD2, CAD3, cad4, cad5, cad6, cad7" InitialState = "CAD1">
      <f:facet name="cad1">
      <f:subview id="subUoCad">
      <h:form id="formUOCad">
      <ui:include src="UOCad.xhtml">
      <ui:param name="next" value="cad2" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      
      <f:facet name="cad2">
      <f:subview id="subUoCad2">
      <h:form id="formPerCad">
      <ui:include src="/pages/fragments/perOpCadFragment.xhtml">
      <ui:param name="previous" value="cad1" />
      <ui:param name="next" value="cad3" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      
      <f:facet name="cad3">
      <f:subview id="subUoCad3">
      <h:form id="formMacCad">
      <ui:include src="medMacCad.xhtml">
      <ui:param name="previous" value="cad2" />
      <ui:param name="next" value="cad4" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      
      <f:facet name="cad4">
      <f:subview id="subUoCad4">
      <h:form id="formMedCad">
      <ui:include src="medHorCad.xhtml">
      <ui:param name="previous" value="cad3" />
      <ui:param name="next" value="cad5" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      
      <f:facet name="cad5">
      <f:subview id="subUoCad5">
      <h:form id="formPadCad">
      <ui:include src="/pages/fragments/padCadFragment.xhtml">
      <ui:param name="previous" value="cad4" />
      <ui:param name="next" value="cad6" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      
      <f:facet name="cad6">
      <f:subview id="subUoCad6">
      <h:form id="formCliCad">
      <ui:include src="cliEnergiaCad.xhtml">
      <ui:param name="previous" value="cad5" />
      <ui:param name="next" value="cad7" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      
      <f:facet name="cad7">
      <f:subview id="subUoCad7">
      <h:form id="formSisCad">
      <ui:include src="sistIntegCad.xhtml">
      <ui:param name="previous" value="cad6" />
      <ui:param name="next" value="cad1" />
      <ui:param name="tipBlock" value="/pages/op_agua/tipBlock.xhtml" />
      </ Ui: include>
      </ H: form>
      </ F: SubViewer>
      </ F: facet>
      </ Rich: togglePanel>
      </ H: form>
      
      </ Rich: modalPanel>
      

       

       

       

      The pages that are included in togglePanel has the following format:
      perOpCadFragment.xhtml

       

       

      <? 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: c = "http://java.sun.com/jstl/core"
      xmlns: rich = "http://richfaces.org/rich">
      
      <a4j:outputPanel id="cadPadOp">
      <a4j:keepAlive beanName="mBGerenciarPadrao" ajaxOnly="true" />
      <div id="formVert" style="width: 383px;">
      <h5> Step 5 of 7: Standard Operating <strong> </ strong> </ h5>
      
      <div class="contorno_azul">
      
      <table cellpadding="0" cellspacing="0">
      <tr>
      <td> Initial reference: </ td>
      <td> <h: outputText value = "Reference End"
      rendered = "# {mBGerenciarPadrao.isEditing}" /> </ td>
      </ Tr>
      <tr>
      <td> <rich: calendar
      disabled = "# {} mbGerenciarPadrao.enableReferenciaFinal"
      oncurrentdateselected = "event.rich.component.selectDate (event.rich.date)"
      popup = "false" styleClass = "special btn2"
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.dataInicio"
      locale = "en" required = "true" showFooter = "false" id = "dtRferencia"
      requiredMessage = "Field initial reference is mandatory!">
      </ Rich: calendar> </ td>
      <td> <rich: calendar
      disabled =! mbGerenciarPadrao.enableReferenciaFinal "
      oncurrentdateselected = "event.rich.component.selectDate (event.rich.date)"
      popup = "false" styleClass = "special btn2"
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.dataFim"
      locale = "en" required = "true" showFooter = "false"
      id = "dtRferenciaFinal"
      requiredMessage = "Campo ultimate reference is mandatory!">
      </ Rich: calendar> </ td>
      </ Tr>
      </ Table>
      <p style="clear: both;"> <label> Maximum: </ label>
      <H: inputText
      maxlength = "6"
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.tempoMaximo"
      style = "width: 103px" id = "tm"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Average time: </ label> <h: inputText
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.tempoMedio"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      
      </ H: inputText> </ p>
      
      <p> <label> Minimum: </ label>
      <H: inputText
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.tempoMinimo"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Maximum volume: </ label>
      <H: inputText
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.volumeMaximo"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Average Volume: </ label>
      <H: inputText
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.volumeMedio"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Minimum volume: </ label>
      <H: inputText
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.volumeMinimo"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Maximum flow rate: </ label>
      <H: inputText
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.vazaoMaxima"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Average throughout: </ label>
      <H: inputText required = "true"
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.vazaoMedia"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <p> <label> Minimum flow </ label>
      <H: inputText required = "true"
      value = "# {} mBGerenciarPadrao.padraoFuncionamento.vazaoMinima"
      style = "width: 103px"
      disabled = "# {mbGerenciarPadrao.enableReferenciaFinal}">
      </ H: inputText> </ p>
      
      <c:if test="#{!empty tipBlock}">
      <ui:include src="#{tipBlock}" />
      <ui:param name="formName" value="subUoCad5:formPadCad" />
      </ C: if> </ div>
      </ Div>
      </ A4j: outputPanel>
      
      

       

      The page that provides the navigation and the following: tipBlock.xhtm

       

       

       

       

      <H: panelGrid styleClass = "infopanel" cellpadding = "0" cellspacing = "0" columnClasses = "col"
             border = "0" columns = "1">
              <h:panelGrid columns="2">
                <Rich: toggleControl switchToState = "# {previous}" value = "# {empty previous?'''' Previous'}"
                 ajaxSingle = "true" process = "# {formName}" actionListener = "# {mbUnidadeOperacional.toggleValidate}">
                 
                 </ Rich: toggleControl>
                 
                <Rich: toggleControl switchToState = "# {next}" value = "# {empty next?'': 'Next' '}"
                   actionListener = "# {} mbUnidadeOperacional.toggleValidate" ajaxSingle = "true" process = "# {formName}">
                
                </ Rich: toggleControl>
              </ H: panelGrid>
          </ H: panelGrid>
      

       

      I am using RichFaces 3.3.3 final
      I used the process attribute in toggleControl because otherwise he would not arrow data in the bean, but put it this way is only
      by setting the data in the first two forms after the coming of the toggle does not work anymore, all other pages use the same
      same structure of this page.
      If anyone can help I am grateful.
      Any help or tip or sample are welcome.
      Thanks.

        • 1. Re: problems with TogglePanel 2
          godoy

          please reply me, save me

          • 2. Re: problems with TogglePanel 2
            ilya_shaikovsky

            at first nested forms not allowed in JSF.

             

            <h:form id="formToogle">
            <Rich: togglePanel switchType = "ajax" id = "togglePanel1"
            stateOrder = "CAD1, CAD2, CAD3, cad4, cad5, cad6, cad7" InitialState = "CAD1">
            <f:facet name="cad1">
            <f:subview id="subUoCad">
            <h:form id="formUOCad">
            1 of 1 people found this helpful
            • 3. Re: problems with TogglePanel 2
              godoy

              What u need is a way to isolate the contents of each facet of TogglePanel in a form, how can I do this?
              Thanks and a great New Year to all.

               

               

               


              if I get the <h:form id="formToogle"> does not work in the following error:

               

               

               

              org.richfaces.component.EnclosingFormRequiredException: class org.richfaces.component.html.HtmlTogglePanel (id="j_id139") did not find parent form.
                  at org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(FormUtil.java:45)
                  at org.richfaces.renderkit.html.TogglePanelTemplate.doEncodeBegin(TogglePanelTemplate.java:92)
                  at org.richfaces.renderkit.html.TogglePanelTemplate.doEncodeBegin(TogglePanelTemplate.java:86)
                  at org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:100)
                  at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
                  at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:275)
                  at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)

               

               

              What u need is a way to isolate the contents of each facet of TogglePanel in a form, how can I do this?
              Thanks and a great New Year to all.