ICEfaces
  1. ICEfaces
  2. ICE-4457

Error in example code demonstrating the bridge connection status events

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.1
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      Using: ff 3.0.10 and ie7.0.6001.18000
      Server: Tomcat 6.0.18
      ICEFaces: 1.8.0
      IDE: MyEclipse Enterprise 7.1.1-20090310
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Removing the whole id tag from the body element works:

      <body>
      <script type="text/javascript">
      Ice.onSessionExpired('document:body', function() {
      alert('Session has expired!');
      });
      </script>
      Show
      Removing the whole id tag from the body element works: <body> <script type="text/javascript"> Ice.onSessionExpired('document:body', function() { alert('Session has expired!'); }); </script>

      Description

      I think there is a bug in the documentation:
      "IceFacesDeveloperGuide.pdf" v1.8

      In the Javascript section on page 28.

      The example code does not work. It throws an exception: javax.faces.FacesException: java.lang.IllegalArgumentException: document:body

      Here is the code:

      <body id="document:body">
      <script type="text/javascript">
      Ice.onSessionExpired('document:body', function() {
      alert('Session has expired!');
      });
      </script>

      When I remove the whole id tag from the body element it works:

      <body>
      <script type="text/javascript">
      Ice.onSessionExpired('document:body', function() {
      alert('Session has expired!');
      });
      </script>

      Just removing the colon (:) from body id tag will also NOT work, because then you will get an JavaScript error:
      Error: H.asElement() is null
      Source File: http://localhost/xmlhttp/1241601129027/icefaces-d2d.js
      Line: 36

      Maybe You should adjust your documentation.
      But maybe I'm wrong.

        Activity

        Hide
        Ken Fyten added a comment -

        Please review and add a comment that indicates what the example code snippet should look like so I can add it to the Rel. Notes, if necessary.

        Show
        Ken Fyten added a comment - Please review and add a comment that indicates what the example code snippet should look like so I can add it to the Rel. Notes, if necessary.
        Hide
        Uei Liece added a comment -

        Hi Ken,

        the example code should look like:

        <body>
        ...
        <script type="text/javascript">
        Ice.onSessionExpired('document:body', function()

        { alert('Session has expired!'); }

        );
        </script>
        ...
        </body>

        Notes:
        The reason why the original example does not work is because Tomcat6 throws an IllegalArgumentException when you are using the colon in an HTML element ID attribute.

        Show
        Uei Liece added a comment - Hi Ken, the example code should look like: <body> ... <script type="text/javascript"> Ice.onSessionExpired('document:body', function() { alert('Session has expired!'); } ); </script> ... </body> Notes: The reason why the original example does not work is because Tomcat6 throws an IllegalArgumentException when you are using the colon in an HTML element ID attribute.
        Hide
        Mircea Toma added a comment -

        The example in previous comment (from Uei Liece) is the correct one. The <body> tag will always have id="document:body" set by DOMResponseWriter.

        Show
        Mircea Toma added a comment - The example in previous comment (from Uei Liece) is the correct one. The <body> tag will always have id="document:body" set by DOMResponseWriter.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Uei Liece
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: