rsc_five_class_targets.lview 7.21 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 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing $
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <div/>
        <script type="text/javascript"><![CDATA[
            function rsc201_class_target_query() {
                $('rsc_five_class_targets_result_ds').query();
            }
            
            function rsc201_class_target_grid_submit() {
                var result_ds = $('rsc_five_class_targets_result_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            
            function rsc201_class_target_grid_add() {
                $('rsc201_class_target_grid').showEditorByRecord($('rsc_five_class_targets_result_ds').create());
            }
            
           
            
            function rsc201_class_target_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
                parent.shMenu('show');
            }
            
            
            
            function rsc201ModifyPageRenderer(value, record, name) {
                if(record.get('include_target_value')=='Y')
                {
	                var five_class_target_code = record.get('five_class_target');
	                if (record.isNew) {
	                    return '';
	                }
	                return '<a href="javascript:rsc201OpenPage(\'' + five_class_target_code + '\')">${l:RSC_FIVE_CLASS_TARGET.TARGET_VALUE_DEFINE}</a>';
	            }
            }
            
            function rsc201OpenPage(value) {
                new Leaf.Window({
                    id: 'rsc_five_class_target_value',
                    url: 'rsc_five_class_target_value.lview?five_class_target_code=' + value,
                    title: '${l:RSC_FIVE_CLASS_TARGETS.DETAIL_TITLE}',
                    height: 430,
                    width: 680
                });
            }
            
            function five_class_target_code_ef(record, name) {
                if(record.isNew)
                {
                    return 'rsc_five_class_targets_result_grid_tf';
                }
                else
                {
                    return '';
                }
            
            }
            
            function submitSuccess_reflashResultDs(ds,rec)
            {
                ds.query();
            }
            
            
            function usageTypeFunction(record,name)
            {
                if(record.isNew)
                {
                    return 'rsc_five_class_targets_result_grid_comb';
                }
                else
                {
                    return '';
                }
            }
            
        ]]></script>
        <a:dataSets>
            <a:dataSet id="rsc_five_class_target_object" lookupCode="RSC201_TARGET_OBJECT"/>
            <a:dataSet id="rsc_five_class_targets_query_ds"/>
            <a:dataSet id="rsc_data_type" lookupCode="HLS050_DATA_TYPE"/>
            <a:dataSet id="rec200_usage_type_ds" lookupCode="RSC200_RSC_FIVE_CLASS_USAGE_TYPE"/>
            <a:dataSet id="rsc200_target_uom_ds" loadData="true" model="rsc.RSC201.fnd_uom_codes_vl"/>
            <a:dataSet id="rsc_five_class_targets_result_ds" autoCount="true" autoQuery="true" fetchAll="false" model="rsc.RSC201.rsc_five_class_target" pageSize="15" queryDataSet="rsc_five_class_targets_query_ds" queryUrl="${/request/@context_path}/autocrud/rsc.RSC201.rsc_five_class_target/query?ORDER_FIELD=five_class_target_code" selectable="true">
                <a:fields>
                    <a:field name="five_class_target" required="true"/>
                    <a:field name="name" required="true"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="include_target_value" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="usage_type_desc" displayField="code_value_name" options="rec200_usage_type_ds" prompt="RSC_FIVE_CLASS_TARGET.USAGE_TYPE" required="true" returnField="usage_type" valueField="code_value"/>
                    <a:field name="target_object_desc" displayField="code_value_name" options="rsc_five_class_target_object" prompt="RSC_FIVE_CLASS_TARGET.TARGET_OBJECT" required="true" returnField="target_object" valueField="code_value"/>
                    <a:field name="target_uom_desc" displayField="description_text" options="rsc200_target_uom_ds" prompt="RSC_FIVE_CLASS_TARGET.TARGET_UOM" returnField="target_uom" valueField="uom_code"/>
                    <a:field name="target_type_desc" displayField="code_value_name" options="rsc_data_type" required="true" returnField="target_type" valueField="code_value"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="submitSuccess_reflashResultDs"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="rsc201_class_target_quit" text="HLS.EXIT"/>
                <a:gridButton click="rsc201_class_target_query" text="HLS.QUERY"/>
                <a:gridButton click="rsc201_class_target_grid_add" text="HLS.NEW"/>
                <a:gridButton click="rsc201_class_target_grid_submit" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:grid id="rsc201_class_target_grid" bindTarget="rsc_five_class_targets_result_ds" height="490" marginWidth="20" navBar="true" width="1000">
                <a:columns>
                    <a:column name="five_class_target" editorFunction="five_class_target_code_ef" sortable="true" width="130"/>
                    <a:column name="name" editor="rsc_five_class_targets_result_grid_tf" sortable="true" width="100"/>
                    <a:column name="description" editor="rsc_five_class_targets_result_grid_tf" sortable="true" width="200"/>
                    <a:column name="usage_type_desc" editorFunction="usageTypeFunction"/>
                    <a:column name="target_type_desc" editor="rsc_five_class_targets_result_grid_comb" prompt="RSC_FIVE_CLASS_TARGET.USAGE_TYPE" sortable="true" width="100"/>
                    <a:column name="target_uom_desc" editor="rsc_five_class_targets_result_grid_comb" width="80"/>
                    <a:column name="target_object_desc" editor="rsc_five_class_targets_result_grid_comb" width="100"/>
                    <a:column name="include_target_value" editor="rsc_five_class_targets_result_grid_ckb" width="50"/>
                    <a:column align="center" prompt="RSC_FIVE_CLASS_TARGET.TARGET_VALUE_DEFINE" renderer="rsc201ModifyPageRenderer" width="80"/>
                    <a:column name="enabled_flag" editor="rsc_five_class_targets_result_grid_ckb" width="50"/>
                </a:columns>
                <a:editors>
                    <a:textField id="rsc_five_class_targets_result_grid_tf"/>
                    <a:checkBox id="rsc_five_class_targets_result_grid_ckb"/>
                    <a:comboBox id="rsc_five_class_targets_result_grid_comb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>