sch_schedule_create.lview 5.86 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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: scheduleCreateScreen
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query model="sch.sch_default_value" rootPath="default_value_record"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        
        function scheduleCreateScreen_save()
        {
            var ds=$('scheduleCreateScreen_mainDs');
            var record=ds.getAt(0);
            record.set('setup_mode','SIMPLE');
            ds.submit();
        }
        
        function scheduleCreateScreen_close()
        {
            $('sch_schedule_create').close();
        }
        
        function refresh_scheduleCreateScreen_futureRunTimeDs(schedule_name)
        {
            var ds=$('scheduleCreateScreen_futureRunTimeDs');
            ds.setQueryParameter('schedule_name',schedule_name);
            ds.query();
        }
        
        function scheduleCreateScreen_onUpdate_mainDs(ds,record,name,value,oldvalue)
        {
            if(name=='para_freq')
            {
                controlPage(record,value);
            }
            if(name=='short_desc')
            {
                setDefaultValue(record,'full_desc',value);
            }
        }
        
        function scheduleCreateScreen_onSubmitsuccess_mainDs(ds)
        {
            var record=ds.getAt(0);
            record.getField('schedule_name').setReadOnly(true);
            scheduleMaintainScreen_query();
            refresh_scheduleCreateScreen_futureRunTimeDs(record.get('schedule_name'));
        }
        
        
        
        ]]></script>
        <a:dataSets>
            <a:dataSet id="scheduleCreateScreen_defaultDateDs" loadData="true" model="sch.sch_default_value"/>
            <a:dataSet id="scheduleCreateScreen_freqSimpleDs" lookupCode="SCH_SCHEDULE_FREQ_SIMPLE"/>
            <a:dataSet id="scheduleCreateScreen_futureRunTimeDs" model="sch.SCH101.sch_schedule_future_run_time">
                <a:fields>
                    <a:field name="run_time" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="scheduleCreateScreen_mainDs" autoCreate="true" model="sch.SCH101.sch_schedule_save_simple">
                <a:fields>
                    <a:field name="para_byday" validator="validate_1_7"/>
                    <a:field name="para_bymonthday" validator="validate_para_bymonthday"/>
                    <a:field name="start_date" defaultValue="${/model/default_value_record/record/@today}" required="true"/>
                    <a:field name="end_date" defaultValue="${/model/default_value_record/record/@never_date}" required="true"/>
                    <a:field name="para_interval" defaultValue="1" required="true" validator="validate_para_interval"/>
                    <a:field name="schedule_name" required="true" validator="validate_functionName"/>
                    <a:field name="short_desc" required="true"/>
                    <a:field name="full_desc" required="true"/>
                    <a:field name="para_byhour" validator="validate_0_23"/>
                    <a:field name="para_byminute" validator="validate_0_59"/>
                    <a:field name="para_bysecond"/>
                    <a:field name="para_freq_display" displayField="code_value_name" options="scheduleCreateScreen_freqSimpleDs" required="true" returnField="para_freq" valueField="code_value"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="scheduleCreateScreen_onUpdate_mainDs"/>
                    <a:event name="submitsuccess" handler="scheduleCreateScreen_onSubmitsuccess_mainDs"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="scheduleCreateScreen_close" text="HLS.CLOSE"/>
                <a:gridButton click="scheduleCreateScreen_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="2" title=" ">
                <a:textField name="schedule_name" bindTarget="scheduleCreateScreen_mainDs" maxLength="30" typeCase="upper"/>
                <a:textField name="short_desc" bindTarget="scheduleCreateScreen_mainDs"/>
                <a:datePicker name="start_date" bindTarget="scheduleCreateScreen_mainDs" renderer="Leaf.formatDate"/>
                <a:datePicker name="end_date" bindTarget="scheduleCreateScreen_mainDs" renderer="Leaf.formatDate"/>
                <a:numberField name="para_interval" allowDecimals="false" allowNegative="false" bindTarget="scheduleCreateScreen_mainDs"/>
                <a:comboBox name="para_freq_display" bindTarget="scheduleCreateScreen_mainDs" prompt="SCH101.SCH_SCHEDULE.PARA_FREQ"/>
                <a:textField name="para_bymonthday" bindTarget="scheduleCreateScreen_mainDs"/>
                <a:textField name="para_byday" bindTarget="scheduleCreateScreen_mainDs"/>
                <a:textField name="para_byhour" bindTarget="scheduleCreateScreen_mainDs"/>
                <a:textField name="para_byminute" bindTarget="scheduleCreateScreen_mainDs"/>
                <a:textField name="full_desc" bindTarget="scheduleCreateScreen_mainDs"/>
            </a:form>
            <a:form column="2" title="SCH101.FUTURE_RUN_TIME">
                <a:textArea name="run_time" bindTarget="scheduleCreateScreen_futureRunTimeDs" height="170" width="450"/>
            </a:form>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
        (
        function init_scheduleCreateScreen()
        {
            var ds=$('scheduleCreateScreen_mainDs');
            var record=ds.getAt(0);
            
            var value=record.get('para_freq');
            controlPage(record,value);
        })();
        
        ]]></script>
    </a:view>
</a:screen>