United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4865025 HTML Documents with <input type="button"> not recognized
JDK-4865025 : HTML Documents with not recognized

Details
Type:
Bug
Submit Date:
2003-05-15
Status:
Closed
Updated Date:
2003-05-19
Project Name:
JDK
Resolved Date:
2003-05-19
Component:
client-libs
OS:
solaris_8,windows_2000
Sub-Component:
javax.swing
CPU:
x86,sparc
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.3.1_06,1.4.1,1.4.2
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description

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) 
======================================================================

                                    

Comments
EVALUATION

<input type="button">
is part of html 4.0
Currently we do not fully support this standart.

Closing this bug as dup for
4296022
                                     
2004-06-11



Hardware and Software, Engineered to Work Together