Author: niallp Date: Wed Apr 6 00:44:55 2005 New Revision: 160263 URL: http://svn.apache.org/viewcvs?view=rev&rev=160263 Log: Port to 1.2.x branch - Bug 21603 Automatic readonly/disabled settings in struts-html reported by Shai Berger.
Modified: struts/el/branches/STRUTS_1_2_BRANCH/doc/userGuide/struts-html-el.xml struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTag.java struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTagBeanInfo.java Modified: struts/el/branches/STRUTS_1_2_BRANCH/doc/userGuide/struts-html-el.xml URL: http://svn.apache.org/viewcvs/struts/el/branches/STRUTS_1_2_BRANCH/doc/userGuide/struts-html-el.xml?view=diff&r1=160262&r2=160263 ============================================================================== --- struts/el/branches/STRUTS_1_2_BRANCH/doc/userGuide/struts-html-el.xml (original) +++ struts/el/branches/STRUTS_1_2_BRANCH/doc/userGuide/struts-html-el.xml Wed Apr 6 00:44:55 2005 @@ -1642,6 +1642,17 @@ </attribute> <attribute> + <name>disabled</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + Set to <code>true</code> if the Form's input fields should be + disabled. + </info> + <since>Struts 1.2.7</since> + </attribute> + + <attribute> <name>enctype</name> <required>false</required> <rtexprvalue>true</rtexprvalue> @@ -1701,6 +1712,17 @@ <info> JavaScript event handler executed if the form is submitted. </info> + </attribute> + + <attribute> + <name>readonly</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <info> + Set to <code>true</code> if the Form's input fields should be + read only. + </info> + <since>Struts 1.2.7</since> </attribute> <attribute> Modified: struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTag.java URL: http://svn.apache.org/viewcvs/struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTag.java?view=diff&r1=160262&r2=160263 ============================================================================== --- struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTag.java (original) +++ struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTag.java Wed Apr 6 00:44:55 2005 @@ -42,6 +42,11 @@ */ private String actionExpr; /** + * Instance variable mapped to "disabled" tag attribute. + * (Mapping set in associated BeanInfo class.) + */ + private String disabledExpr; + /** * Instance variable mapped to "enctype" tag attribute. * (Mapping set in associated BeanInfo class.) */ @@ -72,6 +77,11 @@ */ private String onsubmitExpr; /** + * Instance variable mapped to "readonly" tag attribute. + * (Mapping set in associated BeanInfo class.) + */ + private String readonlyExpr; + /** * Instance variable mapped to "scriptLanguage" tag attribute. * (Mapping set in associated BeanInfo class.) */ @@ -108,6 +118,11 @@ */ public String getActionExpr() { return (actionExpr); } /** + * Getter method for "disabled" tag attribute. + * (Mapping set in associated BeanInfo class.) + */ + public String getDisabledExpr() { return (disabledExpr); } + /** * Getter method for "enctype" tag attribute. * (Mapping set in associated BeanInfo class.) */ @@ -138,6 +153,11 @@ */ public String getOnsubmitExpr() { return (onsubmitExpr); } /** + * Getter method for "readonly" tag attribute. + * (Mapping set in associated BeanInfo class.) + */ + public String getReadonlyExpr() { return (readonlyExpr); } + /** * Getter method for "scriptLanguage" tag attribute. * (Mapping set in associated BeanInfo class.) */ @@ -174,6 +194,11 @@ */ public void setActionExpr(String actionExpr) { this.actionExpr = actionExpr; } /** + * Setter method for "disabled" tag attribute. + * (Mapping set in associated BeanInfo class.) + */ + public void setDisabledExpr(String disabledExpr) { this.disabledExpr = disabledExpr; } + /** * Setter method for "enctype" tag attribute. * (Mapping set in associated BeanInfo class.) */ @@ -204,6 +229,11 @@ */ public void setOnsubmitExpr(String onsubmitExpr) { this.onsubmitExpr = onsubmitExpr; } /** + * Setter method for "readonly" tag attribute. + * (Mapping set in associated BeanInfo class.) + */ + public void setReadonlyExpr(String readonlyExpr) { this.readonlyExpr = readonlyExpr; } + /** * Setter method for "scriptLanguage" tag attribute. * (Mapping set in associated BeanInfo class.) */ @@ -241,12 +271,14 @@ { super.release(); setActionExpr(null); + setDisabledExpr(null); setEnctypeExpr(null); setFocusExpr(null); setFocusIndexExpr(null); setMethodExpr(null); setOnresetExpr(null); setOnsubmitExpr(null); + setReadonlyExpr(null); setScriptLanguageExpr(null); setStyleExpr(null); setStyleClassExpr(null); @@ -279,6 +311,10 @@ this, pageContext)) != null) setAction(string); + if ((bool = EvalHelper.evalBoolean("disabled", getDisabledExpr(), + this, pageContext)) != null) + setDisabled(bool.booleanValue()); + if ((string = EvalHelper.evalString("enctype", getEnctypeExpr(), this, pageContext)) != null) setEnctype(string); @@ -302,6 +338,10 @@ if ((string = EvalHelper.evalString("onsubmit", getOnsubmitExpr(), this, pageContext)) != null) setOnsubmit(string); + + if ((bool = EvalHelper.evalBoolean("readonly", getReadonlyExpr(), + this, pageContext)) != null) + setReadonly(bool.booleanValue()); if ((bool = EvalHelper.evalBoolean("scriptLanguage", getScriptLanguageExpr(), this, pageContext)) != null) Modified: struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTagBeanInfo.java URL: http://svn.apache.org/viewcvs/struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTagBeanInfo.java?view=diff&r1=160262&r2=160263 ============================================================================== --- struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTagBeanInfo.java (original) +++ struts/el/branches/STRUTS_1_2_BRANCH/src/share/org/apache/strutsel/taglib/html/ELFormTagBeanInfo.java Wed Apr 6 00:44:55 2005 @@ -40,6 +40,10 @@ null, "setActionExpr")); } catch (IntrospectionException ex) {} try { + proplist.add(new PropertyDescriptor("disabled", ELTextTag.class, + null, "setDisabledExpr")); + } catch (IntrospectionException ex) {} + try { proplist.add(new PropertyDescriptor("enctype", ELFormTag.class, null, "setEnctypeExpr")); } catch (IntrospectionException ex) {} @@ -66,6 +70,10 @@ try { proplist.add(new PropertyDescriptor("onsubmit", ELFormTag.class, null, "setOnsubmitExpr")); + } catch (IntrospectionException ex) {} + try { + proplist.add(new PropertyDescriptor("readonly", ELTextTag.class, + null, "setReadonlyExpr")); } catch (IntrospectionException ex) {} try { proplist.add(new PropertyDescriptor("scope", ELFormTag.class, --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]