<?xml version="1.0" encoding="UTF-8"?>
<!-- 
   create by xuls 2014-10-9
   for calc column related
 -->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <script type="text/javascript"><![CDATA[
			function hls053_related_add(){
			    $('hls053_result_gd').showEditorByRecord($('hls053_column_related_result_ds').create());
			}
			function hls053_related_query(){
			    $('hls053_column_related_result_ds').query();
			}
			function hls053_related_save(){
			    $('hls053_column_related_result_ds').submit();
			}
			function hls053_related_clear(){
			    $('hls053_result_gd').clear();
			}
			function hls053_related_remove(){
			    $('hls053_result_gd').remove();
			}
			function hls053_loved_fun(record,name){
			    if (record.isNew){
			        return 'hls053_loved';
			    }
			    return '';
			}
			function hls053_comed_fun(record,name){
			    if (record.isNew){
			        return 'hls053_comed';
			    }
			    return '';
			}
		]]></script>
        <a:dataSets>
            <a:dataSet id="hls053_related_type_ds" lookupCode="HLS053_RELATED_TYPE"/>
            <a:dataSet id="hls053_column_relate_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="related_type_desc" displayField="code_value_name" options="hls053_related_type_ds" returnField="related_type" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls053_column_related_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS053.hls_fin_calc_column_related" queryDataSet="hls053_column_relate_query_ds" selectable="true">
                <a:fields>
                    <a:field name="column_code" autoComplete="true" lovGridHeight="320" lovHeight="500" lovService="hls.HLS053.hls_fin_calc_column_code_lov" lovWidth="550" typeCase="upper">
                        <a:mapping>
                            <a:map from="column_code" to="column_code"/>
                            <a:map from="column_name" to="column_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="related_column_code" autoComplete="true" lovGridHeight="320" lovHeight="500" lovService="hls.HLS053.hls_fin_calc_column_code_lov" lovWidth="550" typeCase="upper">
                        <a:mapping>
                            <a:map from="column_code" to="related_column_code"/>
                            <a:map from="column_name" to="related_column_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="related_type_desc" displayField="code_value_name" options="hls053_related_type_ds" returnField="related_type" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls053_related_add" text="HLS.NEW"/>
                <a:gridButton click="hls053_related_remove" text="HLS.REMOVE"/>
                <a:gridButton click="hls053_related_save" text="HLS.SAVE"/>
                <a:gridButton click="hls053_related_clear" text="HLS.CLEAR"/>
                <a:gridButton click="hls053_related_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="3" title="HAP_QUERY_TITLE">
                <a:textField name="column_code" bindTarget="hls053_column_relate_query_ds" prompt="计算器字段" typeCase="upper"/>
                <a:textField name="related_column_code" bindTarget="hls053_column_relate_query_ds" prompt="关联字段" typeCase="upper"/>
                <a:comboBox name="related_type_desc" bindTarget="hls053_column_relate_query_ds" prompt="关联类型"/>
            </a:form>
            <a:grid id="hls053_result_gd" bindTarget="hls053_column_related_result_ds" marginHeight="150" marginWidth="50" navBar="true">
                <a:columns>
                    <a:column name="column_code" editorFunction="hls053_loved_fun" prompt="计算器字段" width="100"/>
                    <a:column name="column_name" prompt="字段名称" width="200"/>
                    <a:column name="related_type_desc" editorFunction="hls053_comed_fun" prompt="关联类型"/>
                    <a:column name="related_column_code" editorFunction="hls053_loved_fun" prompt="关联字段"/>
                    <a:column name="related_column_name" prompt="字段名称" width="200"/>
                </a:columns>
                <a:editors>
                    <a:comboBox id="hls053_comed"/>
                    <a:lov id="hls053_loved"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
