<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangguangfan  
    $Date: 2012-12-10 上午10:23:04  
    $Revision: 1.0  
    $Purpose: 租赁渠道定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default">
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
            function queryFunction() {
                $('hls_lease_channel_result_ds').query();
            }
            
            function channelCodeFunction(record, name) {
                if (record.isNew) {
                    return 'channelCodeEditor';
                } else {
                    return '';
                }
            }
            
            function hls_102_back() {
                history.go(-1);
            }
            
            function hls_102_next() {
                history.go(1);
            }
            
            function hls_102_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
            }
            
            function hls_102_grid_add() {
                $('hls_lease_channel_grid').showEditorByRecord($('hls_lease_channel_result_ds').create());
            }
            
            function hls_102_grid_clear() {
                $('hls_lease_channel_grid').clear();
            }
            
            function hls_102_grid_submit() {
                var result_ds = $('hls_lease_channel_result_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_lease_channel_result_ds" autoQuery="true" model="hls.HLS102.hls_lease_channel" selectable="true">
                <a:fields>
                    <a:field name="lease_channel" required="true"/>
                    <a:field name="description" required="true"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls_102_back" text="HLS.BACK"/>
                <a:gridButton click="hls_102_next" text="HLS.FORWARD"/>
                <a:gridButton click="hls_102_quit" text="HLS.EXIT"/>
                <a:gridButton click="hls_102_grid_add" text="HLS.NEW"/>
                <a:gridButton click="hls_102_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="hls_102_grid_submit" text="HLS.SAVE"/>
                <a:gridButton click="queryFunction" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:grid id="hls_lease_channel_grid" bindTarget="hls_lease_channel_result_ds" marginHeight="100" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="lease_channel" editorFunction="channelCodeFunction" width="250"/>
                    <a:column name="description" editor="descriptionEdit" width="300"/>
                    <a:column name="enabled_flag" editor="flagEdit" width="100"/>
                </a:columns>
                <a:editors>
                    <a:textField id="channelCodeEditor" maxLength="2"/>
                    <a:textField id="descriptionEdit"/>
                    <a:checkBox id="flagEdit"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
