Skip to content

form input tag disabled attribute only works for string input [SPR-6790] #11456

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions