Struts 1
  1. Struts 1
  2. STR-3006

Struts HTML taglib's select element doesn't support proper onfocus events in IE7

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0, 1.0.1, 1.0.2, 1.1.1, 1.2.2, 1.2.4, 1.2.6 Beta, 1.2.7, 1.2.8, 1.2.9, 1.3.5, 1.3.6, 1.3.7, 1.4.0
    • Fix Version/s: None
    • Component/s: Tag Libraries
    • Labels:
      None
    • Environment:
      Any
    • Flags:
      Patch

      Description

      There is a known issue with IE7 and the plain <select> input element... let's say for example you have this:

      <html>
      <head>
      <title></title>
      </head>
      <body>
      <select onFocus="this.style.backgroundColor='#ff0000';">
      <option value="1">1</option>
      <option value="2">2</option>
      </select>
      </body>
      </html>

      In IE7, when you click on the dropdown arrow, the list of items will not immediately show up, you need to click it twice. This is due to the onFocus handler being attached. This is a known issue with IE. The solution is to simply add an onFocusIn handler which (usually) mimics the onFocus handler.

      However, in Struts 1, because the HTML taglib does not allow arbitrary attributes (something I believe it should, and I said as much on a BugZilla ticket which I can't seem to find in JIRA now, and along with it I suggested adding a strictHTML attribute, which would default to true, to allow (false) or disallow (true) arbitrary attributes), you cannot properly deal with this issue at present if you use the HTML taglib.

      Attached please find two updated files, BaseHandlerTag.java and struts-html.tld, which adds support for the onfocusin attribute.

      I marked this as Minor, but for those of us dealing with this issue right now, it's more like a Major I also consider it a bug since I don't see any viable work-around (someone can correct me if I'm wrong... and yes, not using the HTML taglib is I suppose a valid answer, but I'd be looking for something else)

      1. struts-html.tld.diff
        0.8 kB
        Frank W. Zammetti
      2. struts-html.tld
        343 kB
        Frank W. Zammetti
      3. struts-attr-tag-v2.patch
        34 kB
        Niall Pemberton
      4. BaseHandlerTag.java.diff
        1 kB
        Frank W. Zammetti
      5. BaseHandlerTag.java
        31 kB
        Frank W. Zammetti

        Issue Links

          Activity

          Frank W. Zammetti created issue -
          Frank W. Zammetti made changes -
          Field Original Value New Value
          Attachment BaseHandlerTag.java [ 13409 ]
          Frank W. Zammetti made changes -
          Attachment struts-html.tld [ 13410 ]
          Niall Pemberton made changes -
          Attachment struts-attr-tag.patch [ 13412 ]
          Niall Pemberton made changes -
          Attachment struts-attr-tag-v2.patch [ 13413 ]
          Niall Pemberton made changes -
          Attachment struts-attr-tag.patch [ 13412 ]
          Frank W. Zammetti made changes -
          Attachment BaseHandlerTag.java.diff [ 13414 ]
          Attachment struts-html.tld.diff [ 13415 ]
          Paul Benedict made changes -
          Link This issue depends on STR-2463 [ STR-2463 ]
          Jeff Turner made changes -
          Project Import Mon Feb 01 01:03:21 UTC 2010 [ 1264986201992 ]
          Mark Thomas made changes -
          Workflow jira [ 12492922 ] Default workflow, editable Closed status [ 12545333 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12545333 ] jira [ 12548689 ]
          Mark Thomas made changes -
          Workflow jira [ 12548689 ] Default workflow, editable Closed status [ 12558807 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12558807 ] jira [ 12587162 ]
          Gavin made changes -
          Link This issue depends on STR-2463 [ STR-2463 ]
          Gavin made changes -
          Link This issue depends upon STR-2463 [ STR-2463 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Frank W. Zammetti
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development