<@_dictionary id=id><#assign a=object/></@_dictionary>
<form method="post" autocomplete="off" action="cmsDictionary/save?callbackType=closeCurrent&navTabId=cmsDictionary/list" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
    <input name="oldId" type="hidden" value="${(a.id.id)!}" />
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="formBar">
        <ul>
            <li><button type="submit" class="buttonActive"><@t.page 'button.save'/></button></li>
            <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
        </ul>
    </div>
    <div class="pageContent">
        <div class="pageFormContent" layoutH>
            <dl class="nowrap">
                <dt><@t.page 'id'/>:</dt>
                <dd>
                    <input class="required" name="id.id" remote="cmsDictionary/virify<#if id?has_content>?oldId=${(a.id.id)!}</#if>" data-msg-remote="<@t.message 'verify.hasExist.code'/>" type="text" size="20" maxlength="20" value="${(a.id.id)!}"/>
                </dd>
            </dl>
            <dl class="nowrap">
                <dt><@t.page 'name'/>:</dt>
                <dd>
                    <input class="required" name="name" type="text" size="20" maxlength="100" value="${(a.name)!}"/>
                    <label><input name="multiple" type="checkbox"${((a.multiple)?has_content&&a.multiple)?then(' checked="true"','')?no_esc}/><@t.page 'multiple_select'/></label>
                </dd>
            </dl>
            <table class="list nowrap itemDetail" addButton="<@t.page 'button.new_line'/>" width="100%">
                <thead>
                    <tr>
                        <th type="text" name="dataList[#index#].id.value" size="20" fieldClass="required" fieldAttrs="{maxlength:50}"><@t.page 'value'/></th>
                        <th type="text" name="dataList[#index#].text" size="50" fieldClass="required" fieldAttrs="{maxlength:100}"><@t.page 'text'/></th>
                        <th type="del" width="100"><@t.page 'operate'/></th>
                    </tr>
                </thead>
                <tbody>
            <#if id?has_content>
                <@_dictionaryDataList dictionaryId=id>
                    <#list list as d>
                        <tr>
                            <td>
                                <input type="hidden" name="dataList[${d?index}].id.dictionaryId" value="${(d.id.dictionaryId)!}"/>
                                <input type="text" name="dataList[${d?index}].id.value" value="${d.id.value}" size="20" class="required" maxlength="50"/>
                            </td>
                            <td>
                                <input type="text" name="dataList[${d?index}].text" value="${d.text}" size="50" class="required" maxlength="100"/>
                            </td>
                            <td>
                                <a href="javascript:void(0)" class="btnDel "><@t.page 'button.delete'/></a>
                            </td>
                        </tr>
                    </#list>
                </@_dictionaryDataList>
            </#if>
                </tbody>
            </table>
        </div>
    </div>
</form>