sys_condition_procedure_entry.lview 5.7 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-8-5 下午04:36:03  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="sys209_condition_procedure_link" url="${/request/@context_path}/modules/sys/SYS209/sys_condition_procedure.lview"/>
        <script type="text/javascript"><![CDATA[
            function sys209_confirm() {
                if ($('sys209_condition_procedure_entry_ds').validate()) {
                    var record = $('sys209_condition_procedure_entry_ds').getAt(0);
                    var condition_usage_type = record.get('condition_usage_type');
                    var condition_procedure_f = record.get('condition_procedure_f');
                    var condition_procedure_t = record.get('condition_procedure_t');
                    var url = $('sys209_condition_procedure_link').getUrl() + '?condition_usage_type=' + condition_usage_type;
                    if (Leaf.isEmpty(condition_procedure_f)) {
                        url = url + '&condition_procedure_f=' + condition_procedure_f;
                    }
                    if (Leaf.isEmpty(condition_procedure_t)) {
                        url = url + '&condition_procedure_t=' + condition_procedure_t;
                    }
                    Leaf.go(url);
                }
            }
            
            function sys209_condition_procedure_entry_update(ds, record, name, value, oldValue) {
                if (name == 'condition_usage_type') {
                    if (!Leaf.isEmpty(value)) {
                        record.getField('condition_procedure_f').setLovService('sys.SYS209.sys_condition_procedure');
                        record.getField('condition_procedure_f').setLovPara('condition_usage_type', record.get('condition_usage_type'));
                        record.getField('condition_procedure_t').setLovService('sys.SYS209.sys_condition_procedure');
                        record.getField('condition_procedure_t').setLovPara('condition_usage_type', record.get('condition_usage_type'));
                    } else {
                        record.getField('condition_procedure_f').setLovService('');
                        record.set('condition_procedure_f', '');
                        record.set('description_f', '');
                        record.getField('condition_procedure_t').setLovService('');
                        record.set('condition_procedure_t', '');
                        record.set('description_t', '');
                    }
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="sys209_condition_procedure_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_procedure_f" autoComplete="true" lovGridHeight="320" lovHeight="460" lovWidth="550">
                        <a:mapping>
                            <a:map from="condition_procedure" to="condition_procedure_f"/>
                            <a:map from="description" to="description_f"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="condition_procedure_t" autoComplete="true" lovGridHeight="320" lovHeight="460" lovWidth="550">
                        <a:mapping>
                            <a:map from="condition_procedure" to="condition_procedure_t"/>
                            <a:map from="description" to="description_t"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="sys209_condition_procedure_entry_update"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="sys209_confirm" text="CONFIRM" width="80"/>
            </a:screenTopToolbar>
            <a:form title="SYS209.CONDITION_PROCEDURE_EDIT">
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:lov name="condition_usage_type" bindTarget="sys209_condition_procedure_entry_ds" prompt="SYS200.SYS_CONDITION_USAGE_TYPE.CONDITION_USAGE_TYPE"/>
                    <a:textField name="condition_usage_type_desc" bindTarget="sys209_condition_procedure_entry_ds" prompt=""/>
                </a:hBox>
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:lov name="condition_procedure_f" bindTarget="sys209_condition_procedure_entry_ds" prompt="SYS209.CONDITION_PROCEDURE_F"/>
                    <a:textField name="description_f" bindTarget="sys209_condition_procedure_entry_ds" prompt=""/>
                </a:hBox>
                <a:hBox labelSeparator=" " labelWidth="100">
                    <a:lov name="condition_procedure_t" bindTarget="sys209_condition_procedure_entry_ds" prompt="SYS209.CONDITION_PROCEDURE_T"/>
                    <a:textField name="description_t" bindTarget="sys209_condition_procedure_entry_ds" prompt=""/>
                </a:hBox>
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>