Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Feb 2, 2010 · 1 comment
Assignees
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

Comments

@spring-projects-issues
Copy link
Collaborator

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've generally revised the evaluation of boolean 'true' attribute expressions in our JSP form tag library: We leniently accept 'true' in all common flavors now - Boolean.TRUE and Boolean.valueOf(String)

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants