提交 0e5b8c70 编写于 作者: K kohsuke

allow the @value to be used if present. This is useful when creating a list of...

allow the @value to be used if present. This is useful when creating a list of check boxes and bind it to List<String>

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@33719 71c3de6d-444a-0410-be80-ed276b4c234a
上级 8568692f
......@@ -1683,9 +1683,15 @@ function buildFormTree(form) {
case "checkbox":
p = findParent(e);
var checked = xor(e.checked,Element.hasClassName(e,"negative"));
if(!e.groupingNode)
addProperty(p, e.name, checked);
else {
if(!e.groupingNode) {
v = e.getAttribute("value");
if (v) {// if the value is present, we'll either set the value or not. useful for an array of checkboxes
if (checked)
addProperty(p, e.name, v);
} else {// otherwise it'll bind to boolean
addProperty(p, e.name, checked);
}
} else {
if(checked)
addProperty(p, e.name, e.formDom = {});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册