6 Replies Latest reply on Jun 3, 2011 5:44 AM by Christian Lehmann

    panel problems in Chrome and Internet Explorer

    u j Novice

      I have a collapsible panel which works fine in Firefox latest, but has problems in Chrome (latest) and IE 9.

       

      The show case http://richfaces-showcase.appspot.com/richfaces/component-sample.jsf?demo=collapsiblePanel

      works for Chrome, but can only open, but not close in IE 9 for switchType=ajax.

       

      In my case, the panel cannot even be opened in Chrome and IE. No idea why it behaves differently than the showcase.

       

      If I change to switch type client, in works in IE, but in Chrome it gives the error:

       

      THIS PAGE CONTAINS THE FOLLOWING ERRORS:

      error on line 173 at column 28: Attribute onclick redefined

      BELOW IS A RENDERING OF THE PAGE UP TO THE FIRST ERROR.

       

      Thanks

        • 1. panel problems in Chrome and Internet Explorer
          Pavol Pitonak Master

          Hi,

           

          I was able to reproduce the bug in IE9 but not in Chrome. I have Chrome 11.0.696.68 which is, as far as I know, the latest stable version at the moment.

           

          The bug is probably caused by Mojarra (see https://issues.jboss.org/browse/RF-10770 and http://java.net/jira/browse/JAVASERVERFACES-1981). I tried our testing application with MyFaces 2.0.4 and it works fine.

           

          To work around the problem in IE9, you can try compatibility view of browser. You can turn it on in address bar.

           

          Regards,

          Palo

          1 of 1 people found this helpful
          • 2. panel problems in Chrome and Internet Explorer
            u j Novice

            Thanks for the reply!

             

            You are right that the compatibility view solves the IE problem, but for a public web site it is not a solution.

             

            I use jboss 6. At startup the following line is printed:

            17:47:33,193 INFO  [JSFImplManagementDeployer] Initialized 3 JSF configurations: [Mojarra-1.2, MyFaces-2.0, Mojarra-2.0]

            I am not a JBoss configuration expert. Do you really need these 3 configurations? Can I keep only MyFaces to solve the IE 9 problem? Or can you set the order in which JSF configs are used? Should I update the jboss to the latest MyFaces version?

             

            The Chrome problem I could solve. I replaced

            <h:link value="#{msg.Login}" onclick="#{rich:component('loginpopup')}.show(); return false;" />

            with

            <h:commandLink value="#{msg.Login}">

            <rich:componentControl target="loginpopup" operation="show" />

            </h:commandLink>

             

            Thanks,

            Ulrich

            • 3. panel problems in Chrome and Internet Explorer
              u j Novice

              I found how to set the used JSF implementation here:

              http://docs.jboss.org/jbossas/6/JSF_Guide/en-US/html_single/index.html#changing.jsf.config

               

              However, when I change to MyFaces, the old problem is gone, but I get on IE 9 the error:

               

              Caused by: java.lang.IllegalArgumentException: ContentTypeList does not contain a supported content type: text/css

                  at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.selectContentType(HtmlRendererUtils.java:1914) [:2.0.5]

                  at org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.createResponseWriter(HtmlRenderKitImpl.java:223) [:2.0.5]

                  at org.apache.myfaces.shared_impl.view.JspViewDeclarationLanguageBase.renderView(JspViewDeclarationLanguageBase.java:154) [:2.0.5]

                  at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263) [:2.0.5]

                  at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59) [:2.0.5]

                  at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59) [:2.0.5]

               

              and the style sheets are not loaded.

              text/css is widely used by RichFaces on the produced page, e.g.:

              //--></script><link rel="stylesheet" media="screen" type="text/css" href="/myapp/faces/rfRes/icons.ecss?db=eAHL6rC8BQAEkAIG&amp;ln=org.richfaces" />

               

              Do you know if this is a bug in MyFaces? Doesn't it happen to you? I updated to MyFaces 2.0.5.

               

              Thanks

              • 4. panel problems in Chrome and Internet Explorer
                Pavol Pitonak Master

                Hi,

                 

                I tried collapsible panel with MyFaces 2.0.4 and 2.0.5 and I cannot reproduce the bug with css. Could you provide war with some simple app?

                 

                Palo

                • 5. panel problems in Chrome and Internet Explorer
                  u j Novice

                  Uff, that would be quit a work. I think it is not necessarily related to the collapsable panel. From what I see it is a bug in MyFaces when the content type is text/css. The type text/* is not matched.

                  I tried the latest Majorra 2.1 and now it works except for this bug:

                  https://issues.jboss.org/browse/RF-9925

                  But that happens only for project stage Development, so I don't care too much.

                   

                  Thanks

                  • 6. Re: panel problems in Chrome and Internet Explorer
                    Christian Lehmann Newbie

                    Hi,

                     

                    I have a similar error message with Chrome (11.0.696.71) and Safari (5.0.5 / 7533.21.1) when using <h:commandlink with onclick attribute)

                     

                    "error on line 7 at column 24: Attribute onclick redefined"

                     

                    The code

                     


                    <h:form id="listForm">

                    <h:commandLink onclick="alert('toto')" value="test"/>

                    </h:form>

                     

                    produces

                     

                    <form id="listForm" name="listForm" method="post" action="/test.jsf" enctype="application/x-www-form-urlencoded">

                     

                    <a href="#" onclick="alert('toto')" onclick="var a=function(){alert('toto');};var b=function(){clearFormHiddenParams_listForm('listForm');document.forms['listForm']['listForm:j_idcl'].value='listForm:j_id2'; document.forms['listForm'].submit(); return false;};return (a()==false) ? false : b();">test</a>

                     

                    <input type="hidden" name="listForm:j_idcl" />

                    <script type="text/javascript" language="Javascript">

                    //<![CDATA[

                     

                    function clearFormHiddenParams_listForm(curFormName) {

                      var curForm = document.forms[curFormName];

                    curForm.elements['listForm:j_idcl'].value = null;

                    }

                    //]]>

                    </script>

                    <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id3" />

                    <input type="hidden" name="listForm" value="listForm" /></form>

                     

                    Is this a known bug ? Could you help me find a workaround ?

                     

                    Thanks

                     

                    Best regards

                     

                    Chris