dmkarr 2002/10/03 22:34:19 Modified: contrib/struts-el/doc/userGuide struts-html-el.xml contrib/struts-el/src/share/org/apache/strutsel/taglib/html ELOptionTag.java contrib/struts-el/web/exercise-taglib html-select.jsp doc/userGuide struts-html.xml src/share/org/apache/struts/taglib/html OptionTag.java OptionsCollectionTag.java OptionsTag.java Log: Enabled "onclick", "ondblclick", "onmousedown", "onmouseover", "onmousemove", and "onmouseup" attributes in "html-el:img" tag, as the base class supports them. Added "styleId" attribute to "html:option" and "html-el:option", as the HTML specification specifies that the "id" attribute is legal in "option" elements. Added comments wrt "html:optionsCollection" and "html:options" indicating that the "styleId" attribute is specifically not supported because of uniqueness constraints for the "id" attribute. Added a simple test of the "styleId" attribute of "html-el:option" to the strutsel-exercise-taglib application. Revision Changes Path 1.2 +80 -0 jakarta-struts/contrib/struts-el/doc/userGuide/struts-html-el.xml Index: struts-html-el.xml =================================================================== RCS file: /home/cvs/jakarta-struts/contrib/struts-el/doc/userGuide/struts-html-el.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- struts-html-el.xml 26 Sep 2002 04:54:38 -0000 1.1 +++ struts-html-el.xml 4 Oct 2002 05:34:19 -0000 1.2 @@ -2567,6 +2567,26 @@ </attribute> <attribute> + <name>onclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element receives a + mouse click. + </info> + </attribute> + + <attribute> + <name>ondblclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element receives a + mouse double click. + </info> + </attribute> + + <attribute> <name>onkeydown</name> <required>false</required> <rtexprvalue>false</rtexprvalue> @@ -2597,6 +2617,56 @@ </attribute> <attribute> + <name>onmousedown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element is under the mouse + pointer and a mouse button is depressed. + </info> + </attribute> + + <attribute> + <name>onmousemove</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element is under the + mouse pointer and the pointer is moved. + </info> + </attribute> + + <attribute> + <name>onmouseout</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element was under the + mouse pointer but the pointer was moved outside the element. + </info> + </attribute> + + <attribute> + <name>onmouseover</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element was not under + the mouse pointer but the pointer is moved inside the element. + </info> + </attribute> + + <attribute> + <name>onmouseup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + JavaScript event handler executed when this element is under the + mouse pointer and a mouse button is released. + </info> + </attribute> + + <attribute> <name>page</name> <required>false</required> <rtexprvalue>false</rtexprvalue> @@ -3880,6 +3950,16 @@ <rtexprvalue>false</rtexprvalue> <info> CSS styles to be applied to this HTML element. + </info> + </attribute> + + <attribute> + <name>styleId</name> + <required>false</required> + <rtexprvalue>false</rtexprvalue> + <info> + Identifier to be assigned to this HTML element (renders + an "id" attribute). </info> </attribute> 1.4 +10 -9 jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELOptionTag.java Index: ELOptionTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELOptionTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ELOptionTag.java 1 Oct 2002 04:25:50 -0000 1.3 +++ ELOptionTag.java 4 Oct 2002 05:34:19 -0000 1.4 @@ -160,11 +160,12 @@ setStyleClass(null); } -// try { -// setStyleId((String) evalAttr("styleId", getStyleId(), String.class)); -// } catch (NullAttributeException ex) { -// setStyleId(null); -// } + try { + setStyleId((String) evalAttr("styleId", getStyleId(), + String.class)); + } catch (NullAttributeException ex) { + setStyleId(null); + } try { setValue((String) evalAttr("value", getValue(), String.class)); 1.2 +1 -1 jakarta-struts/contrib/struts-el/web/exercise-taglib/html-select.jsp Index: html-select.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/contrib/struts-el/web/exercise-taglib/html-select.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- html-select.jsp 26 Sep 2002 04:54:41 -0000 1.1 +++ html-select.jsp 4 Oct 2002 05:34:19 -0000 1.2 @@ -71,7 +71,7 @@ <html-el:option value="Single 6">Single 6</html-el:option> <html-el:option value="Single 7">Single 7</html-el:option> <html-el:option value="Single 8">Single 8</html-el:option> - <html-el:option value="Single 9">Single 9</html-el:option> + <html-el:option value="Single 9" styleId="flork">Single 9</html-el:option> </html-el:select> </td> </tr> 1.25 +23 -0 jakarta-struts/doc/userGuide/struts-html.xml Index: struts-html.xml =================================================================== RCS file: /home/cvs/jakarta-struts/doc/userGuide/struts-html.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- struts-html.xml 31 Aug 2002 13:15:02 -0000 1.24 +++ struts-html.xml 4 Oct 2002 05:34:19 -0000 1.25 @@ -4170,6 +4170,16 @@ </attribute> <attribute> + <name>styleId</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + Identifier to be assigned to this HTML element (renders + an "id" attribute). + </info> + </attribute> + + <attribute> <name>styleClass</name> <required>false</required> <rtexprvalue>true</rtexprvalue> @@ -4272,6 +4282,13 @@ that bean which will return the collection.</li> </ul> + + <p>Note that this tag does not support a <code>styleId</code> + attribute, as it would have to apply the value to all the + <code>option</code> elements created by this element, which would + mean that more than one <code>id</code> element might have the same + value, which the HTML specification says is illegal.</p> + </info> <attribute> @@ -4386,6 +4403,12 @@ in that it makes more consistent use of the <code>name</code> and <code>property</code> attributes, and allows the collection to be more easily obtained from the enclosing form bean.</p> + + <p>Note that this tag does not support a <code>styleId</code> + attribute, as it would have to apply the value to all the + <code>option</code> elements created by this element, which would + mean that more than one <code>id</code> element might have the same + value, which the HTML specification says is illegal.</p> </info> <attribute> 1.11 +33 -4 jakarta-struts/src/share/org/apache/struts/taglib/html/OptionTag.java Index: OptionTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionTag.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- OptionTag.java 23 Sep 2002 05:13:43 -0000 1.10 +++ OptionTag.java 4 Oct 2002 05:34:19 -0000 1.11 @@ -195,6 +195,30 @@ this.styleClass = styleClass; } + /** + * The identifier associated with this tag. + */ + protected String styleId = null; + + /** + * Return the style identifier for this tag. + */ + public String getStyleId() { + + return (this.styleId); + + } + + /** + * Set the style identifier for this tag. + * + * @param styleId The new style identifier + */ + public void setStyleId(String styleId) { + + this.styleId = styleId; + + } /** * The server value for this option, also used to match against the @@ -278,6 +302,11 @@ if (style != null) { results.append(" style=\""); results.append(style); + results.append("\""); + } + if (styleId != null) { + results.append(" id=\""); + results.append(styleId); results.append("\""); } if (styleClass != null) { 1.7 +10 -1 jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsCollectionTag.java Index: OptionsCollectionTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsCollectionTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- OptionsCollectionTag.java 23 Sep 2002 05:13:43 -0000 1.6 +++ OptionsCollectionTag.java 4 Oct 2002 05:34:19 -0000 1.7 @@ -335,6 +335,15 @@ /** * Add an option element to the specified StringBuffer based on the * specified parameters. + *<p> + * Note that this tag specifically does not support the + * <code>styleId</code> tag attribute, which causes the HTML + * <code>id</code> attribute to be emitted. This is because the HTML + * specification states that all "id" attributes in a document have to be + * unique. This tag will likely generate more than one <code>option</code> + * element element, but it cannot use the same <code>id</code> value. It's + * conceivable some sort of mechanism to supply an array of <code>id</code> + * values could be devised, but that doesn't seem to be worth the trouble. * * @param sb StringBuffer accumulating our results * @param value Value to be returned to the server for this option 1.19 +9 -0 jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java Index: OptionsTag.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/OptionsTag.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- OptionsTag.java 23 Sep 2002 05:13:43 -0000 1.18 +++ OptionsTag.java 4 Oct 2002 05:34:19 -0000 1.19 @@ -352,6 +352,15 @@ /** * Add an option element to the specified StringBuffer based on the * specified parameters. + *<p> + * Note that this tag specifically does not support the + * <code>styleId</code> tag attribute, which causes the HTML + * <code>id</code> attribute to be emitted. This is because the HTML + * specification states that all "id" attributes in a document have to be + * unique. This tag will likely generate more than one <code>option</code> + * element element, but it cannot use the same <code>id</code> value. It's + * conceivable some sort of mechanism to supply an array of <code>id</code> + * values could be devised, but that doesn't seem to be worth the trouble. * * @param sb StringBuffer accumulating our results * @param value Value to be returned to the server for this option
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>