提交 f2c14519 编写于 作者: K Kohsuke Kawaguchi

<select> should retain the initial value as the candidate (instead of showing...

<select> should retain the initial value as the candidate (instead of showing the empty select box until the values get filled in.)

This is useful in retaining the currnet value in case the candidates filling didn't work (for example, the other system we talk to is down.)
上级 f777d5e4
......@@ -41,9 +41,14 @@ THE SOFTWARE.
<f:prepareDatabinding/>
${descriptor.calcFillSettings(field,attrs)} <!-- this figures out the 'fillUrl' and 'fillDependsOn' attribute -->
<j:set var="value" value="${attrs.value ?: instance[attrs.field] ?: attrs.default}" />
<m:select xmlns:m="jelly:hudson.util.jelly.MorphTagLibrary"
class="setting-input ${attrs.checkUrl!=null?'validated':''} select ${attrs.clazz}"
name="${attrs.name ?: '_.'+attrs.field}"
value="${attrs.value ?: instance[attrs.field] ?: attrs.default}"
ATTRIBUTES="${attrs}" EXCEPT="field clazz" />
value="${value}"
ATTRIBUTES="${attrs}" EXCEPT="field clazz">
<j:if test="${value!=null}">
<option value="${value}">${value}</option>
</j:if>
</m:select>
</j:jelly>
......@@ -1535,8 +1535,9 @@ function updateListBox(listBox,url,config) {
originalOnSuccess(rsp);
},
config.onFailure = function(rsp) {
var l = $(listBox);
l.options[0] = null;
// deleting values can result in the data loss, so let's not do that
// var l = $(listBox);
// l.options[0] = null;
}
new Ajax.Request(url, config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册