<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhenwei.yin  
    $Date: 2012-12-11 下午4:03:43  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
            function hls_314_queryDivision() {
                $('hls_car_organization_result_ds').query();
            }
            
            function hls_314_resetDivision() {
                $('hls_division_query_ds').reset();
            }
            
            function hls_314_grid_submit() {
                var result_ds = $('hls_car_organization_result_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            
            function hls_314_grid_add() {
                $('hls_car_organization_grid').showEditorByRecord($('hls_car_organization_result_ds').create());
            }
            
            function hls_314_next() {
                history.go(1);
            }
            
            function hls_314_back() {
                history.go(-1);
            }
            
            function hls_314_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
            }
            
            function hls_314_grid_clear() {
                $('hls_car_organization_grid').clear();
            }
            
            function hls314divisionCodeFunction(record, name) {
                if (record.isNew) {
                    return 'hls314_division_code_tf';
                } else {
                    return '';
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls_car_organization_result_ds" autoQuery="true" fetchAll="false" model="hls.HLS314.hls_car_organization" selectable="true">
                <a:fields>
                    <a:field name="organization_code" required="true"/>
                    <a:field name="organization_name" required="true"/>
                    <a:field name="external_business_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <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_314_back" text="HLS.BACK"/>
                <a:gridButton click="hls_314_next" text="HLS.FORWARD"/>
                <a:gridButton click="hls_314_quit" text="HLS.EXIT"/> -->
                <a:gridButton click="hls_314_grid_add" text="HLS.NEW"/>
                <a:gridButton click="hls_314_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="hls_314_grid_submit" text="HLS.SAVE"/>
                <!--         <a:gridButton click="hls_314_queryDivision" text="HLS.QUERY"/> -->
            </a:screenTopToolbar>
            <a:grid id="hls_car_organization_grid" bindTarget="hls_car_organization_result_ds" marginHeight="100" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="organization_code" align="left" editorFunction="hls314divisionCodeFunction" prompt="事业部代码" sortable="true" width="250"/>
                    <a:column name="organization_name" align="left" editor="hls314_division_description_tf" prompt="事业部名称" width="300"/>
                    <a:column name="external_business_flag" align="center" editor="hls314_division_result_grid_cb" prompt="外部事业部" width="100"/>
                    <a:column name="enabled_flag" align="center" editor="hls314_division_result_grid_cb" prompt="启用" width="100"/>
                </a:columns>
                <a:editors>
                    <a:textField id="hls314_division_code_tf" maxLength="2"/>
                    <a:textField id="hls314_division_description_tf"/>
                    <a:checkBox id="hls314_division_result_grid_cb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>