form input tag disabled attribute only works for string input [SPR-6790] #11456
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Travis Dixon opened SPR-6790 and commented
AbstractHtmlInputElementTag.isDisabled has the single line:
return "true".equals(evaluate("disabled", getDisabled()));
When getDisabled has the el ${true}
evaluate returns Boolean.TRUE which is of a different type to the String "true" so .equals resolves to false.
A solution would be:
final Object eval = evaluate("disabled", getDisabled());
return eval == null ? false : "true".equals(eval.toString());
This would better match the description of the disabled element in the tld:
http://static.springsource.org/spring/docs/2.0.x/reference/spring-form.tld.html#spring-form.tld.input
"HTML Optional Attribute. Setting the value of this attribute to 'true' (without the quotes) will disable the HTML element."
Affects: 2.5.6
Reference URL: http://forum.springsource.org/showthread.php?p=281813
Referenced from: commits 4d897e7
The text was updated successfully, but these errors were encountered: