Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4865025

HTML Documents with <input type="button"> not recognized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.1_06, 1.4.1, 1.4.2
    • client-libs
    • x86, sparc
    • solaris_8, windows_2000



      Name: jk109818 Date: 05/15/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
      Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)


      FULL OS VERSION :
      SunOS muirwoods 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-60


      A DESCRIPTION OF THE PROBLEM :
      HTMLDocument is supposed to recognize tags of the form

      <input type="button">

      according to the documentation of FormAction:

        * The following are the model assignments for the
      * various type of form elements.
        * <table>
        * <tr>
        * <th>Element Type
        * <th>Model Type
        * <tr>
        * <td>input, type button
        * <td>DefaultButtonModel

      however buttons don't seem to be recognized. This appears to be because FormAction.setModel at line 2923 of HTMLDocument.java 1.148 omits "button" from the statement:

      void setModel(String type, MutableAttributeSet attr) {
      if (type.equals("submit") ||
      type.equals("reset") ||
      type.equals("image")) {

      // button model
      attr.addAttribute(StyleConstants.ModelAttribute,
      new DefaultButtonModel());
      ...



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Try viewing something with an <input type="button">; I get nothing.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
              ElementIterator iter = new ElementIterator(document);
              Element elem = null;
              while ((elem = iter.next()) != null)
              {
                  if (elem.getName().equalsIgnoreCase(HTML.Tag.INPUT.toString()))
                  {
                      Object model = elem.getAttributes().getAttribute(StyleConstants.ModelAttribute);
                      if (model instanceof DefaultButtonModel)
                      {
                          DefaultButtonModel buttonModel = (DefaultButtonModel) model;
                          buttonModel.addActionListener(listener);
                          System.out.println(elem.toString());
                      }
                  }
              }
          }

      ---------- END SOURCE ----------
      (Review ID: 185737)
      ======================================================================

            idk Igor Kushnirskiy (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: