<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="hls.HLS030.hls_doc_layout_tab_for_tab_config" rootpath="screen_config_record"/>
        <a:model-query fetchAll="true" model="hls.HLS030.hls_doc_layout_sequence" rootpath="total_list"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
    	
        ]]></script>
        <a:freeMarker><![CDATA[
    		<script type="text/javascript">
    			
    			function ${model.getObject('/model/screen_config_record/record/@tab_code')}_screen_save()
        		{
        		    var dsName='${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs';
        		    tab_save(dsName);
        		}
        		
        		function onAdd_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs(ds,record,index)
        		{
        		    onAdd_screenDs(ds,record,index);
        		}
        		
        		function onUpdate_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs(ds,record,name,value,oldValue)
        		{
        		    onUpdate_screenDs(ds,record,name,value,oldValue);
        		}
        		function onFocus_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs_form_lov(el)
        		{
        		    onFocus_screenDs_form_lov(el.record,el.binder.name);
        		}
        		function onLovClick_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs_form_lov(el)
        		{
        		    onLovClick_screenDs_form_lov(el.record,el.binder.name);
        		}
        		
        	</script>
    	]]></a:freeMarker>
        <a:dataSets>
            <a:freeMarker><![CDATA[
        		<a:dataSet id="${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" autoCreate="true">
	        		<a:fields>
	        			<a:field name="column_count" defaultValue="${model.getObject('/model/screen_config_record/record/@column_count')}"/>
	        			<a:field name="row_count" defaultValue="${model.getObject('/model/screen_config_record/record/@row_count')}"/>
	        			<a:field name="total_count" defaultValue="${model.getObject('/model/screen_config_record/record/@total_count')}"/>
	        			<a:field name="tab_code" defaultValue="${model.getObject('/model/screen_config_record/record/@tab_code')}"/>
	        			<a:field name="layout_code" defaultValue="${model.getObject('/model/screen_config_record/record/@layout_code')}"/>
	        			<a:field name="form_column_count" defaultValue="${model.getObject('/model/screen_config_record/record/@form_column_count')}"/>
	        			<a:field name="ds_name" defaultValue="${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs"/>
	                    <#if model.getObject("/model/total_list").getChilds()??>
	                    	<#list model.getObject("/model/total_list").getChilds() as item>
		                    	<a:field name="column_${item.getString('sequence')}" defaultValue="${item.getString('column_name')!""}" autoComplete="true" lovService="hls.HLS030.hls_doc_layout_config_lov?layout_code=${model.getObject('/model/screen_config_record/record/@layout_code')}" lovWidth="800" lovHeight="450" lovGridHeight="300" title="HLS030.HLS_FIN_CALC_CONFIG_TEMPLT.COLUMN_NAME">
		                    		<a:mapping>
			                			<a:map from="prompt" to="column_${item.getString('sequence')}_desc" />
			                			<a:map from="input_mode" to="column_${item.getString('sequence')}_input_mode" />
			                			<a:map from="input_mode_desc" to="column_${item.getString('sequence')}_input_mode_desc" />
			                			<a:map from="column_name" to="column_${item.getString('sequence')}" />
			                		</a:mapping>
			                	</a:field>
			                	<a:field name="column_${item.getString('sequence')}_desc" defaultValue="${item.getString('prompt')!""}"/>
			                	<a:field name="column_${item.getString('sequence')}_input_mode_desc" defaultValue="${item.getString('input_mode_desc')!""}"/>
			                	<a:field name="column_${item.getString('sequence')}_input_mode" defaultValue="${item.getString('input_mode')!""}"/>
		                	</#list>
		                </#if>
	                </a:fields>
	                <a:events>
        				<a:event name="add" handler="onAdd_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" />
        				<a:event name="update" handler="onUpdate_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" />
        			</a:events>
	            </a:dataSet>
        	]]></a:freeMarker>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="${/model/screen_config_record/record/@tab_code}_screen_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:freeMarker><![CDATA[
            	<#if model.getObject("/model/total_list").getChilds()??>
            		<#if model.getObject("/model/screen_config_record/record/@show_box")=='Y'>
            			<a:form title=" "  labelSeparator=" ">
	            			<a:box column="${model.getObject('/model/screen_config_record/record/@form_column_count')!""}"  width="${model.getObject('/model/screen_config_record/record/@box_width')!""}">
	            				<#list model.getObject("/model/total_list").getChilds() as item>
			                		<a:label name="column_${item.getString('sequence')}_desc" bindTarget="${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" style="text-align:right;margin-top:${model.getObject('/model/screen_config_record/record/@margin_top')!""}px;" width="${model.getObject('/model/screen_config_record/record/@label_width')!""}"/>
			                		<a:lov name="column_${item.getString('sequence')}" bindTarget="${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" style="margin-top:${model.getObject('/model/screen_config_record/record/@margin_top')!""}px;" width="${model.getObject('/model/screen_config_record/record/@field_width')!""}">
			                			<a:events>
					                		<a:event name="focus" handler="onFocus_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs_form_lov" />
					                		<a:event name="beforetriggerclick" handler="onLovClick_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs_form_lov" />
					                	</a:events>
			                		</a:lov>
			            		</#list>
	            			</a:box>
            			</a:form>
	            	<#else>
	        			<a:form column="${model.getObject('/model/screen_config_record/record/@form_column_count')}" title=" "  labelSeparator=" ">
		        			<#list model.getObject("/model/total_list").getChilds() as item>
		                		<a:label name="column_${item.getString('sequence')}_desc" bindTarget="${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" style="text-align:right;margin-top:${model.getObject('/model/screen_config_record/record/@margin_top')!""}px;" width="${model.getObject('/model/screen_config_record/record/@label_width')!""}"/>
		                		<a:lov name="column_${item.getString('sequence')}" bindTarget="${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs" style="margin-top:${model.getObject('/model/screen_config_record/record/@margin_top')!""}px;" width="${model.getObject('/model/screen_config_record/record/@field_width')!""}">
		                			<a:events>
				                		<a:event name="focus" handler="onFocus_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs_form_lov" />
				                		<a:event name="beforetriggerclick" handler="onLovClick_${model.getObject('/model/screen_config_record/record/@tab_code')}_screenDs_form_lov" />
				                	</a:events>
		                		</a:lov>
		            		</#list>
	            		</a:form>
            		</#if>
                </#if>
        	]]></a:freeMarker>
        </a:screenBody>
    </a:view>
    <a:view-config><![CDATA[
    ]]></a:view-config>
</a:screen>
