8 Replies Latest reply on May 4, 2007 7:18 PM by vralev

    bug in togglePanel/toggleControl

    vralev

      This works:

      <h:form>
       <rich:togglePanel id="tp" stateOrder="one,two" switchType="ajax">
       <f:facet name="one">One</f:facet>
       <f:facet name="two">Two</f:facet>
       </rich:togglePanel>
       <rich:toggleControl for="tp" value="switch:"></rich:toggleControl>
      </h:form>
      


      Opps code (SS):
      <h:form>
       <rich:togglePanel id="tp" stateOrder="one,two" switchType="client">
       <f:facet name="one">One</f:facet>
       <f:facet name="two">Two</f:facet>
       </rich:togglePanel>
       <rich:toggleControl for="tp" value="switch:"></rich:toggleControl>
      </h:form>
      


      This doesn't:
      <h:form>
       <rich:togglePanel id="tp" stateOrder="one,two" switchType="ajax">
       <f:facet name="one">One</f:facet>
       <f:facet name="two">Two</f:facet>
       </rich:togglePanel>
       <rich:toggleControl for="tp" value="switch:"></rich:toggleControl>
      </h:form>
      


      Firefox says the error is:
      XML error. Expected: </input>.
      Row 6, column 247:<!-- vcp:body/--><div id="j_id2:tp"><div id="j_id2:tp_one" style="display: inherit">One</div><div id="j_id2:tp_two" style="display: none">Two</div><div style="display: none;"><input type="hidden" id="j_id2:tp_input" name="j_id2:tp" value="one"></div><script type="text/javascript">TogglePanelManager.add(new TogglePanel("j_id2:tp", $A(["one", "two"]), "one"));</script></div><a class="dr-tglctrl rich-tglctrl " href="#" id="j_id2:j_id5" onclick="TogglePanelManager.toggleOnClient('j_id2:tp',null);; return false;">switch:</a><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="H4sIAAAAAAAAAJVUPXAbRRR+ukSWYmcSxwFDiswQ4oIM8coJcSbEBch2FN9wNhrbMBAKe31aSaesdo+9Pd2lyYQmFDQUQOUZUlCGloKCn6GgAoaChoqhBipm+Gng7envZJ/42WLn3e5779733rffw58hHyo4/ZrToh1KOBUN8uJei7l66e2vX3l/OrjALYDYB4CjgYJnXNkmQShInbosINT3uedS7UlBtjTVbJ0K2mDKbvt8blsxtiFr7Nf6x598uHDz0+MmT/QsmPWUVA1CWzS+0grqpK5om0VS3U6OSBm3lz0WbUqp4dhOp2fGwetwF6xoIclw3tQb9+rAqnwpmNCkqducrOFWkaoN+daOV7vcD7yKYTm4aH6tPLc5NnRbNhqcValgHCzt98OXknDyH8NXpNBK8m4Ji3FocphlZVjFoYU9PpVMItQepqNBc536+cL3n38xu/vtEbAqMMklrVWoq6Wy4ZhuKhY0Ja/F/nPPJykmoqJJZIrVcMlU29qTQUACRtukWr55Y+7AmSsV6/axirPDAs5mOVT6DssfOZ/FX+42LMjfgjOuFB2mgoQCduBI0dgMhfBEw4ETI3c1DTMJx0qGY6UtrdBpyYGTPuascxmtyFBopjScTrnZeIR8Qr/jfb8N5MqYXNMDH6TdWD8ks48r9tPkMgN4ZND85BksS8kZFV89oe59t//nLxbkbkG+Q3nIYj+XcOJRTKRhcm173dlZLm/ZKxpOlqhLS5oFmsSGEZhyejhPR7qUs7u/n9rdX/jjJwuO2lBs4oxdrNeBgmtaoO6MQVc0nyEiHHNf6FDlUaHHgP4LlwbrpS3ckK8Ao2h7nZ758cEHv73x5jVEa/fR9iEkfhthe4+p+w/fPTv1zg9v9bWhgA0dkDhvjMeSzR+ag+tcxguYTb0AY00dIrOl4fG0+HCmA7Je3nxhx17VULxyldJLl/dolle5WnXsG6uIt3TozkOlIqusTkOuK93DuTKq2p1teZuJtf1vVpfEew+60nXm0HQRzMyrk/fD2JCpKzam+gWzzSaodbd3faEyqmTIp+FcSjtL8XwURfN1vJwPFWfC8KHmH1z/qCH5jLMTA+vIv/Y3Z46fHnZy0UAqJpCuazRRCNOozo3KYEoyN5moMcUUFjwcfooM/gFizKYcTGMKKKcXdSTRnHC5h1Qd1A4ZGC8MrIn/i/EaMxinuhgTme4NcTGN9HwW0p66Z2JFCEHkabd53e+pRA/c6Nfo54E7v9vxntOT97D44VXW4Uj8sGF/A7+TzY/fBwAA" />
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
      


      I am using the snapshot versions from Seam, i think these are the latest. - ajax4jsf-1.1.1-SNAPSHOT.jar and richfaces-3.0.1-SNAPSHOT.jar

      BTW, Over the past week I've been trying to build richfaces on my own, but I always get some unresolved dependencies. Right now it's:
      [INFO] Using default encoding to copy filtered resources.
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Failed to resolve artifact.
      
      Missing:
      ----------
      1) org.richfaces:common:jar:3.0.1-SNAPSHOT
      
       Try downloading the file manually from:
       http://labs.jboss.com/portal/jbossrichfaces/downloads
      
       Then, install it using the command:
       mvn install:install-file -DgroupId=org.richfaces -DartifactId=common \
       -Dversion=3.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
      
       Path to dependency:
       1) org.richfaces:drag-drop:jar:3.0.1-SNAPSHOT
       2) org.richfaces:common:jar:3.0.1-SNAPSHOT
      
      


        • 1. Re: bug in togglePanel/toggleControl

          Help me to recognize what is the difference between two code snippets

          • 2. Re: bug in togglePanel/toggleControl
            vralev

            Oops, sorry.

            this doesn't work (client vs ajax):

            <h:form>
             <rich:togglePanel id="tp" stateOrder="one,two" switchType="client">
             <f:facet name="one">One</f:facet>
             <f:facet name="two">Two</f:facet>
             </rich:togglePanel>
             <rich:toggleControl for="tp" value="switch:"></rich:toggleControl>
            </h:form>
            


            BTW, Just tested with the RC version - it doesn't fix it.

            • 3. Re: bug in togglePanel/toggleControl

              I have copy/pasted you snippet to my test application and it works. Actually, the client type does not send anything to the server and does not require form (However, I tested it with and without form)

              • 4. Re: bug in togglePanel/toggleControl
                vralev

                I just tried IE and it works there.
                Firefox gives me a HTML parsing error, it's not a server side error.

                Firefox version: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

                I will do more testing..

                • 5. Re: bug in togglePanel/toggleControl

                  I have
                  Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

                  No problem.

                  Could you put on the new page this code and check

                  • 6. Re: bug in togglePanel/toggleControl
                    vralev

                    Hmm, I emailed you an URL with the test page I am using hosted on a sandbox machine. You can check it.

                    Otherwise this is the whole page to try to reproduce it:

                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    <html 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:s="http://jboss.com/products/seam/taglib"
                     xmlns:a="https://ajax4jsf.dev.java.net/ajax"
                     xmlns:rich="http://richfaces.ajax4jsf.org/rich">
                    <body>
                    <h:form>
                     <rich:togglePanel id="tp" stateOrder="one,two" switchType="client">
                     <f:facet name="one">One</f:facet>
                     <f:facet name="two">Two</f:facet>
                     </rich:togglePanel>
                     <rich:toggleControl for="tp" value="switch:"></rich:toggleControl>
                     </h:form>
                    </body>
                    </html>
                    
                    


                    I realized that the page is enforcing xhtml which is a bit more strict to parse...

                    • 7. Re: bug in togglePanel/toggleControl

                      try to add < f:view contentType="text/html" > somewhere on your page.

                      • 8. Re: bug in togglePanel/toggleControl
                        vralev

                        With f:view it works. Thanks very much.