MyFaces Trinidad
  1. MyFaces Trinidad
  2. TRINIDAD-818

Core.js: invalid Javascript in Firefox and XHTML

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.3-core
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Java 6, Windows and Linux environments.

      Description

      When accessing forms, Core.js uses javascript sentence "document[x]" (where "x" is the form ID). This works with basic HTML, but not in XHTML documents.

      Changing "document[x]" with "document.forms[x]" my application works fine, both in Firefox and IExplorer.

      1. test.xhtml
        0.4 kB
        Victor S.

        Issue Links

          Activity

          Matthias Weßendorf made changes -
          Assignee Matthias Weßendorf [ matzew ]
          Matthias Weßendorf made changes -
          Link This issue is related to TRINIDAD-1139 [ TRINIDAD-1139 ]
          Hide
          Matthias Weßendorf added a comment -

          yes, you are right.
          the first is not valid in XHTML.

          I noticed this when looking at TRINIDAD-1139
          Once that is fixed this is gone as well.

          Show
          Matthias Weßendorf added a comment - yes, you are right. the first is not valid in XHTML. I noticed this when looking at TRINIDAD-1139 Once that is fixed this is gone as well.
          Victor S. made changes -
          Field Original Value New Value
          Attachment test.xhtml [ 12370184 ]
          Hide
          Victor S. added a comment -

          I attached a very simple XHTML test file with a text input within a form. There is a <script> that assigns a initial value to the text input, but if we use the document['id_of_the_form'] (as Core.js does), Firefox generates a js error. With document.forms['id_of_the_form'] all works correctly.

          This only happen if we use XHTML and force content-type to "application/xhtml+xml" or "application/xml".

          Show
          Victor S. added a comment - I attached a very simple XHTML test file with a text input within a form. There is a <script> that assigns a initial value to the text input, but if we use the document ['id_of_the_form'] (as Core.js does), Firefox generates a js error. With document.forms ['id_of_the_form'] all works correctly. This only happen if we use XHTML and force content-type to "application/xhtml+xml" or "application/xml".
          Hide
          Matthias Weßendorf added a comment -

          I don't see it.

          Show
          Matthias Weßendorf added a comment - I don't see it.
          Victor S. created issue -

            People

            • Assignee:
              Matthias Weßendorf
              Reporter:
              Victor S.
            • Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Development