hn_calendar_rules_readonly.lview 4.18 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ouyangzhaochang2663 $
    $Date: 2010/11/15 07:47:05 $
    $Revision: 1.2 $
    $Purpose: 日历定义-规则
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[     
    ]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function ruleCreatePage_close() {
                $('${/parameter/@winid}').close();
            }
            
            
            
            function editorFun_ruleCreateDs_grid(record, name) {
                if(name=='year')
                {
                    if (record.get('rule_type') != 'FIXED HOLIDAY') {
                        record.getField('year').setRequired(true);
	                    return 'ruleCreateDs_grid_nf';
	                } else {
	                    record.getField('year').setRequired(false);
	                    record.set('year', '');
	                    return '';
	                }
                }
                return '';
            }
            
            
            function monthValidator(record, name, value) {
                if (value < 1 || value > 12) {
                    return '${l:FND_CALENDAR_RULES.MONTH_WRONG}';
                }
                return true;
            }
            
            function dayValidator(record, name, value) {
                if (value < 1 || value > 31) {
                    return '${l:FND_CALENDAR_RULES.DAY_EWRONG}';
                }
                return true;
            }
            
           
        ]]></script>
        <a:dataSets>
            <a:dataSet id="rule_type_ds" lookupCode="CALENDAR_RULE_TYPE"/>
            <a:dataSet id="ruleCreatePage_calendarDs" loadData="true" model="fnd.FND1060.fnd_calendar">
                <a:fields>
                    <a:field name="calendar_code" readOnly="true"/>
                    <a:field name="description" readOnly="true"/>
                    <a:field name="start_date" readOnly="true"/>
                    <a:field name="end_date" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="ruleCreateDs" autoPageSize="true" autoQuery="true" model="hn.HN1060.hn_calendar_rules_req_ln" queryUrl="${/request/@context_path}/autocrud/hn.HN1060.hn_calendar_rules_req_ln/query?request_id=${/parameter/@request_id}" selectable="true">
                <a:fields>
                    <a:field name="request_id" defaultValue="${/parameter/@request_id}" readOnly="true"/>
                    <a:field name="rule_type_display" displayField="code_value_name" options="rule_type_ds" readOnly="true" required="true" returnField="rule_type" valueField="code_value"/>
                    <a:field name="year" readOnly="true"/>
                    <a:field name="month" readOnly="true" required="true" validator="monthValidator"/>
                    <a:field name="day" readOnly="true" required="true" validator="dayValidator"/>
                    <a:field name="description" readOnly="true" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:fieldSet column="2" title="FND_CALENDAR_RULES.CALENDAR_RULE_DEFINE">
                <a:textField name="calendar_code" bindTarget="ruleCreatePage_calendarDs"/>
                <a:textField name="description" bindTarget="ruleCreatePage_calendarDs"/>
                <a:datePicker name="start_date" bindTarget="ruleCreatePage_calendarDs"/>
                <a:datePicker name="end_date" bindTarget="ruleCreatePage_calendarDs"/>
            </a:fieldSet>
            <a:grid id="ruleCreateDs_grid" bindTarget="ruleCreateDs" marginHeight="300" marginWidth="300" navBar="true">
                <a:columns>
                    <a:column name="rule_type_display" sortable="true"/>
                    <a:column name="year" align="right" sortable="true"/>
                    <a:column name="month" align="right" sortable="true"/>
                    <a:column name="day" align="right" sortable="true"/>
                    <a:column name="description" sortable="true" width="150"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>