Modified disabled attribute of input tag to support values "disabled" and "true"

This commit is contained in:
rjy7 2010-07-26 15:15:06 +00:00
parent 019545ccd9
commit 3dadfff50b

View file

@ -215,9 +215,10 @@ public class InputElementFormattingTag extends TagSupport {
} }
private String doDisabled() { private String doDisabled() {
/* only insert the disabled attribute if it has been populated */ /* Only insert the disabled attribute if it has been populated. Support
* both "true" and "disabled" as values. */
String disabled = getDisabled(); String disabled = getDisabled();
if (!StringUtils.isEmpty(disabled)) { if ("true".equals(disabled) || "disabled".equals(disabled)) {
return "disabled=\"disabled\""; return "disabled=\"disabled\"";
} }
return ""; return "";