提交 fdb4e725 编写于 作者: K kohsuke

applied the stapler subtype bindJSON change to SCM browsers, too.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10560 71c3de6d-444a-0410-be80-ed276b4c234a
上级 903da460
......@@ -66,17 +66,9 @@ public class RepositoryBrowsers {
T createInstance(Class<T> type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException {
List<Descriptor<RepositoryBrowser<?>>> list = filter(type);
Object o = parent.get(fieldName);
JSONObject o = (JSONObject)parent.get(fieldName);
if(o==null) return null;
if(o instanceof String && "auto".equals(o))
return null;
if (o instanceof JSONArray) {
JSONArray a = (JSONArray) o;
return type.cast(list.get(a.getInt(0)).newInstance(req,a.getJSONObject(1)));
}
throw new AssertionError(o.getClass()+" : "+o);
return req.bindJSON(type,o);
}
}
......@@ -9,12 +9,11 @@
<j:set var="currentBrowser" value="${scm.browser}"/>
<j:forEach var="d" items="${scmd.browserDescriptors}" varStatus="loop">
<f:dropdownListBlock value="${loop.index}" title="${d.displayName}" selected="${currentBrowser.descriptor==d}">
<f:nested>
<table width="100%">
<j:set var="browser" value="${h.ifThenElse(currentBrowser.descriptor==d, currentBrowser, null)}"/>
<st:include from="${d}" page="${d.configPage}"/>
</table>
</f:nested>
<j:set var="browser" value="${h.ifThenElse(currentBrowser.descriptor==d, currentBrowser, null)}"/>
<tr><td>
<input type="hidden" name="stapler-class" value="${d.clazz.name}" />
</td></tr>
<st:include from="${d}" page="${d.configPage}"/>
</f:dropdownListBlock>
</j:forEach>
</f:dropdownList>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册