<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-8-5 上午11:02:28  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="sys205_condition_layout_link" url="${/request/@context_path}/modules/sys/SYS205/sys_condition_layout.lview"/>
        <script type="text/javascript"><![CDATA[
            function sys205_confirm() {
                if ($('sys205_condition_entry_ds').validate()) {
                    var record = $('sys205_condition_entry_ds').getAt(0);
                    var url = $('sys205_condition_layout_link').getUrl();
                    var condition_usage_type = record.get('condition_usage_type');
                    url = url + '?condition_usage_type=' + condition_usage_type;
                    Leaf.go(url);
                }
            }
            
            function sys205_condition_entry_update(ds, record, name, value, oldValue) {
                if (name == 'condition_usage_type') {
                    if (!Leaf.isEmpty(value)) {
                        record.getField('condition_code_f').setLovService('sys.SYS205.sys_condition');
                        record.getField('condition_code_t').setLovService('sys.SYS205.sys_condition');
                        record.getField('condition_code_f').setLovPara('condition_usage_type', record.get('condition_usage_type'));
                        record.getField('condition_code_t').setLovPara('condition_usage_type', record.get('condition_usage_type'));
                    } else {
                        record.getField('condition_code_f').setLovService('');
                        record.set('condition_code_f', '');
                        record.getField('condition_code_t').setLovService('');
                        record.set('condition_code_t', '');
                    }
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="sys205_condition_class_ds" lookupCode="SYS_CONDITION_CLASS"/>
            <a:dataSet id="sys205_condition_type_ds" lookupCode="SYS_CONDITION_TYPE"/>
            <a:dataSet id="sys205_condition_entry_ds" autoCreate="true">
                <a:fields>
                    <a:field name="condition_usage_type_desc" readOnly="true"/>
                    <a:field name="condition_usage_type" autoComplete="true" lovGridHeight="320" lovHeight="460" lovService="sys.SYS200.sys_condition_usage_type" lovWidth="550" required="true" title="SYS200.SYS_CONDITION_USAGE_TYPE.CONDITION_USAGE_TYPE">
                        <a:mapping>
                            <a:map from="condition_usage_type" to="condition_usage_type"/>
                            <a:map from="description" to="condition_usage_type_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="condition_class_f" displayField="code_value" options="sys205_condition_class_ds" valueField="code_value_name"/>
                    <a:field name="condition_class_t" displayField="code_value" options="sys205_condition_class_ds" valueField="code_value_name"/>
                    <a:field name="condition_type_f" displayField="code_value" options="sys205_condition_type_ds" valueField="code_value_name"/>
                    <a:field name="condition_type_t" displayField="code_value" options="sys205_condition_type_ds" valueField="code_value_name"/>
                    <a:field name="condition_code_f" autoComplete="true" lovGridHeight="320" lovHeight="460" lovWidth="550">
                        <a:mapping>
                            <a:map from="condition_code" to="condition_code_f"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="condition_code_t" autoComplete="true" lovGridHeight="320" lovHeight="460" lovWidth="550">
                        <a:mapping>
                            <a:map from="condition_code" to="condition_code_t"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="sys205_condition_entry_update"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="sys205_confirm" text="CONFIRM" width="80"/>
            </a:screenTopToolbar>
            <a:form title="SYS205.CONDITION_DEFINED">
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:lov name="condition_usage_type" bindTarget="sys205_condition_entry_ds" prompt="SYS200.SYS_CONDITION_USAGE_TYPE.CONDITION_USAGE_TYPE"/>
                    <div><![CDATA[&nbsp;&nbsp;&nbsp;]]></div>
                    <a:textField name="condition_usage_type_desc" bindTarget="sys205_condition_entry_ds" prompt=""/>
                </a:hBox>
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:comboBox name="condition_class_f" bindTarget="sys205_condition_entry_ds" prompt="SYS205.CONDITION_CLASS_F"/>
                    <div><![CDATA[至]]></div>
                    <a:comboBox name="condition_class_t" bindTarget="sys205_condition_entry_ds" prompt=""/>
                </a:hBox>
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:comboBox name="condition_type_f" bindTarget="sys205_condition_entry_ds" prompt="SYS205.CONDITION_TYPE_F"/>
                    <div><![CDATA[至]]></div>
                    <a:comboBox name="condition_type_t" bindTarget="sys205_condition_entry_ds" prompt=""/>
                </a:hBox>
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:lov name="condition_code_f" bindTarget="sys205_condition_entry_ds" prompt="SYS205.CONDITION_CODE_F"/>
                    <div><![CDATA[至]]></div>
                    <a:lov name="condition_code_t" bindTarget="sys205_condition_entry_ds" prompt=""/>
                </a:hBox>
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>