<?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>