如何设置Alfresco下拉列表以显示默认值?

如何设置Alfresco下拉列表以显示默认值?,alfresco,freemarker,alfresco-share,Alfresco,Freemarker,Alfresco Share,我正在使用Alfresco selectone.ftl自定义下拉列表。我不想显示任何空白选项作为默认值。但是Selectone.ftl会自动添加一个空白选项。如何设置我的值作为默认值,删除空白选项。 在某些条件下,我需要在下拉列表中显示用户列表,因为我按照下面的代码定制了SelpTun.FTL,可能对您有帮助。 **这是custom-selectone.ftl** <div class="form-field"> <script type="text/javascript"&g

我正在使用Alfresco selectone.ftl自定义下拉列表。我不想显示任何空白选项作为默认值。但是Selectone.ftl会自动添加一个空白选项。如何设置<代码>我的值<代码>作为默认值,删除空白选项。

在某些条件下,我需要在下拉列表中显示用户列表,因为我按照下面的代码定制了SelpTun.FTL,可能对您有帮助。

**这是custom-selectone.ftl**

<div class="form-field">
<script type="text/javascript">//<![CDATA[
YAHOO.util.Event.onAvailable("${fieldHtmlId}", function(){
    new selectAjax("${fieldHtmlId}");
});
function selectAjax(currentValueHtmlId) {
    this.currentValueHtmlId = currentValueHtmlId;
    var select = Dom.get(this.currentValueHtmlId);
    this.register = function () {
        Alfresco.util.Ajax.jsonGet({
            url: Alfresco.constants.PROXY_URI+"userwebsacript",
            successCallback: {
                fn: this.updateOptions,
                scope: this
            },
            failureCallback: {
                fn: function(){},
                scope: this
            }
        });
    };
    this.updateOptions = function (res) {

        var result = res.serverResponse.responseText;
        if (result.length > 0) {
            var sp=result.split(",");
            for(var i=0;i<sp.length;i++){
                var option = new Option(sp[i], sp[i]);
                select.options[select.options.length] = option;
            }  
        }
    };

    this.register();
}
//]]></script>
<label for="${fieldHtmlId}">${field.label?html}:<#if field.mandatory><span class="mandatory-indicator">${msg("form.required.fields.marker")}</span></#if></label>
<select id="${fieldHtmlId}" name="${field.name}" tabindex="0"
        <#if field.description??>title="${field.description}"</#if>
        <#if field.control.params.size??>size="${field.control.params.size}"</#if>
        <#if field.control.params.styleClass??>class="${field.control.params.styleClass}"</#if>
        <#if field.control.params.style??>style="${field.control.params.style}"</#if>
        <#if field.disabled  && !(field.control.params.forceEditable?? && field.control.params.forceEditable == "true")>disabled="true"</#if>>
        <option value="">Select</option>
</select>

// 0) {
var sp=结果分割(“,”);
对于(var i=0;i
${field.label?html}:${msg(“form.required.fields.marker”)}
挑选