2 Replies Latest reply on Apr 19, 2011 8:29 AM by mdurr

    Ajax problem with Doctype in IE9

    mdurr

      Hi everyone,  I'm having some problems with richfaces (4.0.0.Final) ajax components in IE9. The sample below is more or less a copy of the example on richfaces showcase site. It works fine in IE9.

       

      <?xml version="1.0" encoding="UTF-8" ?>

      <!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"

            xml:lang="en" lang="en"

            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:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j">

       

      <h:head><title>Test</title></h:head>

       

      <h:body>

           <h:form>

              <h:outputLabel value="Name:" for="nameInput"/>

              <h:inputText id="nameInput" value="#{helloWorld.name}">

                  <a4j:ajax event="keyup" render="output"/>

              </h:inputText>

              <h:outputText value="Hello #{helloWorld.name}!" id="output"/>

          </h:form>

      </h:body>

       

      </html>

       

      My problem occurs when I add other components to the page. In this example I have added an ajax enabled a4j:outputPanel *before* the test form: 

       

      <?xml version="1.0" encoding="UTF-8" ?>

      <!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"

            xml:lang="en" lang="en"

            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:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j">

       

      <h:head><title>Test</title></h:head>

       

      <h:body>

          <a4j:outputPanel ajaxRendered="true" id="dummy"/>

       

          <h:form>

              <h:outputLabel value="Name:" for="nameInput"/>

              <h:inputText id="nameInput" value="#{helloWorld.name}">

                  <a4j:ajax event="keyup" render="output"/>

              </h:inputText>

              <h:outputText value="Hello #{helloWorld.name}!" id="output"/>

          </h:form>

      </h:body>

       

      </html>

       

      Now the code stops working in IE9, still works fine in Firefox. After some trial and error I have found two ways to make the example work again:  

      1. Move the a4j output panel below the form
      2. Remove the Doctype tag, changing it to Strict doesn't work you have to remove it completely... 

       

      Does anyone know how to fix this? Removing the doctype makes the page look really bad in all browsers, and only having one working ajax component per page is not really an option... Or might this be a bug in richfaces? 

       

      Best regards,

      Magnus

        • 1. Ajax problem with Doctype in IE9
          ilya_shaikovsky

          sorry has no IE 9 right now to check..

           

          please check if the problem will remain if change the code to:

           

          <h:body>

             <h:panelGroup id="dummy"/>

           

              <h:form>

                  <h:outputLabel value="Name:" for="nameInput"/>

                  <h:inputText id="nameInput" value="#{helloWorld.name}">

                     <f:ajax event="keyup" render="output dummy"/>

                  </h:inputText>

                  <h:outputText value="Hello #{helloWorld.name}!" id="output"/>

              </h:form>

          </h:body>

          if will be the same probably makes sence to look though JSF jira also..

           

          if will works fine - please feel free to create jira issue for RF.

          • 2. Ajax problem with Doctype in IE9
            mdurr

            Sorry to say, but the example works when I use a h:panelGroup instead of the a4j:outputPanel.

             

            I have create RF-10939 in the RichFaces JIRA

             

            Thanx for the quick reply.