提交 077179c7 编写于 作者: B brucechapman

[FIXED HUDSON-2781] Promoted builds with various plugins breaks project configuration screen

editableComboBox.jelly causes infinite recursion in its onload handler when used more than once per page with the same value for id parameter.
changed so that unique names are used to hold the onload function and combo list elements and the previous value of onload



git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14235 71c3de6d-444a-0410-be80-ed276b4c234a
上级 04b859e4
......@@ -25,9 +25,11 @@
name ="${h.defaulted(attrs.name,'_.'+attrs.field)}"
value="${h.defaulted(attrs.value,instance[attrs.field])}"
checkUrl="${checkUrl}" />
<j:set target="${requestScope}" property="editableComboBox" value="${attrs.id}" />
<j:set target="${requestScope}" property="editableComboBoxCount" value="${editableComboBoxCount + 1}" defaultValue="1" />
<j:set var="uniqid" value="${id + editableComboBoxCount}" />
<j:set target="${requestScope}" property="editableComboBox" value="${uniqid}" />
<script type="text/javascript">
var ${id}_values = new Array();
var ${uniqid}_values = new Array();
<!-- fill in values -->
<j:if test="${items!=null}">
......@@ -38,9 +40,9 @@
<d:invokeBody />
<![CDATA[
function ${id}_Callback(value /*, comboBox*/) {
function ${uniqid}_Callback(value /*, comboBox*/) {
var items = new Array();
var candidates = ${id}_values;
var candidates = ${uniqid}_values;
if (value.length > 0) { // if no value, we'll not provide anything
value = value.toLowerCase();
for (var i = 0; i < candidates.length; i++) {
......@@ -56,9 +58,9 @@
]]>
<!-- IE doesn't like a combobox to be created before the page is fully loaded. -->
var oldOnLoadFor${id} = window.onload;
window.onload = function() { if(oldOnLoadFor${id}) oldOnLoadFor${id}();
new ComboBox("${id}", ${id}_Callback);
var oldOnLoadFor${uniqid} = window.onload;
window.onload = function() { if(oldOnLoadFor${uniqid}) oldOnLoadFor${uniqid}();
new ComboBox("${id}", ${uniqid}_Callback);
}
</script>
</j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册