exp_unit_assign_center.lview 4.05 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Lichen  
    $Date: 2012-2-17 下午03:53:57  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:view>
        <div/>
        <script type="text/javascript"><![CDATA[
        
        function centerCodeEdit(record,name){
                if (!record.isNew){
                    return '';
                }else{
                    return 'responsibility_center_code_lov';
                }
            }
            
           function exp_1010_child_grid_add(){
                $('exp_1010_child_grid').showEditorByRecord($('exp1010_org_unit_center_ds').create());
            }
            function exp_1010_child_grid_clear(){
                $('exp_1010_child_grid').clear();
            }
            function exp_1010_child_grid_remove(){
                $('exp_1010_child_grid').remove();
            }
            function exp_1010_child_grid_submit() {
                var result_ds = $('exp1010_org_unit_center_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
        
    ]]></script>
        <a:dataSets>
            <a:dataSet id="org_unit_ds" autoCreate="true" model="exp.EXP1010.exp_org_unit_center">
                <a:fields>
                    <a:field name="unit_code" defaultValue="${/parameter/@unit_code}" readOnly="true"/>
                    <a:field name="org_unit_description" defaultValue="${/parameter/@org_unit_description}" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="exp1010_org_unit_center_ds" autoQuery="true" model="exp.EXP1010.exp_org_unit_center" queryUrl="${/request/@context_path}/autocrud/exp.EXP1010.exp_org_unit_center/query?unit_id=${/parameter/@unit_id}" selectable="true">
                <a:fields>
                    <a:field name="responsibility_center_code" lovGridHeight="300" lovHeight="450" lovService="exp.EXP1010.fnd_responsibility_centers_vl?unit_id=${/parameter/@unit_id}" lovWidth="600" required="true" title="EXP_ORG_UNIT.RESPONSIBILITY_CENTER">
                        <a:mapping>
                            <a:map from="responsibility_center_id" to="responsibility_center_id"/>
                            <a:map from="responsibility_center_code" to="responsibility_center_code"/>
                            <a:map from="responsibility_center_name" to="responsibility_center_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="unit_id" defaultValue="${/parameter/@unit_id}"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="exp_1010_child_grid_add" text="HLS.NEW"/>
                <a:gridButton click="exp_1010_child_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="exp_1010_child_grid_remove" text="HLS.REMOVE"/>
                <a:gridButton click="exp_1010_child_grid_submit" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:fieldSet column="2" title="EXP_ORG_UNIT.UNIT_INFO">
                <a:textField name="unit_code" bindTarget="org_unit_ds" prompt="EXP_ORG_UNIT.UNIT_CODE"/>
                <a:textField name="org_unit_description" bindTarget="org_unit_ds" prompt="EXP_ORG_UNIT.ORG_UNIT_DESCRIPTION"/>
            </a:fieldSet>
            <a:grid id="exp_1010_child_grid" bindTarget="exp1010_org_unit_center_ds" height="330" navBar="true" width="520">
                <a:columns>
                    <a:column name="responsibility_center_code" align="center" editorFunction="centerCodeEdit" prompt="HLS.RESPONSIBILITY_CENTER_CODE" width="180"/>
                    <a:column name="responsibility_center_name" align="center" prompt="HLS.RESPONSIBILITY_CENTER_NAME" width="180"/>
                </a:columns>
                <a:editors>
                    <a:lov id="responsibility_center_code_lov"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>