7 Replies Latest reply on Aug 30, 2012 11:35 PM by asbeel

    bug in dynamically rendered property, richfaces 4

    asbeel

      excuse me for my English translator of google,,,,

      greetings richfaces community, I would like to help me with a problem

       

      I have two forms, the first contains a button that shows(rendered) the second form, the second form has a button but its action does not work.


      This is my code I'm using RichFaces 4 and facelets, need to be two forms and that the second form is inside the outputPanel.

      would greatly appreciate your help

       

      1.jpg

       

      my mb

       

      2.jpg

        • 1. Re: bug in dynamically rendered property, richfaces 4
          iabughosh

          welcome to the community diego,

          try out this code :

          <h:form id="form1">

               <table>

                    <tr>

                         <td>

                              <a4j:commandButton id="btn1" value="prueba" action="#{loginMB.prueba}" execute="@this" render="form2:opn1"/>

                         </td>

                    </tr>

               </table>

          </h:form>

           

           

          <h:form id="form2">

               <a4j:outputPanel id="opn1" rendered="#{rendered=='true'}">         

               <table>

                    <tr>

                         <td>

                              <a4j:commandButton id="btn2" value="mostrar" action="#{loginMB.renderiza}" execute="@this"/>

                         </td>

                    </tr>

               </table>

               </a4j:outputPanel>

          </h:form>

          • 2. Re: bug in dynamically rendered property, richfaces 4
            healeyb

            Hi Diego, what is the reason for using 2 forms?

             

            Regards,

            Brendan.

            • 3. Re: bug in dynamically rendered property, richfaces 4
              asbeel

              from RichFaces 3 my reports pages are divided in two forms

              form1 filters

              form2 result, datatable, link details, etc.

              and the code of my post is similar.

               

              what if it works is to place the outputPanel "opnl" inside Form 2, but I wanted to do it the way I did in richfaces 3.

              thanks for responding

              • 4. Re: bug in dynamically rendered property, richfaces 4
                healeyb

                Hmm ok, I don't personally recommend using multiple forms but if it worked for you in RF3 it ought to be ok now also,

                probably.

                 

                What happens when you try Ibrahim's suggestion? so the problem is that the btn2 action method doesn't fire, have

                you removed any input components from the code you've posted?

                 

                Can you check if the action method for btn2 doesn't fire only the first time you click it, does it work on the second and

                subsequent clicks (this should be fixed by Ibrahim's suggestion...).

                 

                Also does you page have a <h:head></h:head> section somewhere? One more thing, what is the scope of your

                backing bean?

                 

                Regards,

                Brendan.

                • 5. Re: bug in dynamically rendered property, richfaces 4
                  asbeel

                  In my code my btn2 never enters  action, my mb is in request scope and i not imports in the head of page.

                  my code posted is the only in my page.

                   

                  this code if it works or

                  3.jpg

                  • 6. Re: bug in dynamically rendered property, richfaces 4
                    healeyb

                    Diego, if you really want to get the problem solved just don't use multiple forms. I've lost count of the number of times

                    I've come across this issue and it's best just to not do it. If you can think of any good reason to persist with this approach

                    then I'd like to hear it. Use a single form per page, use ajax, send the input fields you need with execute=, avoid all

                    the issues with naming containers, mojarra spec bugs and make your life easy. Trust me this is the way to go.

                     

                    Thanks,

                    Brendan.

                    • 7. Re: bug in dynamically rendered property, richfaces 4
                      asbeel

                      you are right with a single form would have no problem and property execute would help me control what sending the reason that is used by multiple forms that seemed a more orderly, because in my pages usually have many controls (filters, datatables, two or three modalpanels, etc).  Brendan thanks for the advice I will remember.