<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-6-24 下午03:23:39  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:c="leaf.application.action" xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" customizationEnabled="true" trace="true">
    <a:init-procedure>
        <s:server-script import="aut_authority_validate.js"/>
        <a:model-query fetchAll="true" model="hls.HLS030.hls_doc_layout_main" rootPath="layout_main_path"/>
        <a:model-query fetchAll="true" model="cont.CON500.hls_doc_layout_button" rootPath="layout_main_button_path"/>
        <a:model-query defaultWhereClause="t1.parent_table is null and t1.tab_type!=&apos;TAB&apos; and t1.enabled_flag=&apos;Y&apos; and rownum=1" fetchAll="true" model="cont.CON500.con_hls_doc_layout_tab_query" rootPath="base_table_path"/>
        <!-- <s:server-script><![CDATA[
        	var m=$ctx.get('/model/layout_main_button_path');
        	println(m.toXML());
        	println('**************');
        ]]></s:server-script> -->
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            var dynamic_document_id = '${/parameter/@document_id}';
            if ('${/parameter/@document_id}') {
                var detail_mask;
                if ('${/parameter/@winid}') {
                    if (parent.$L.CmpManager.get('${/parameter/@winid}')) {
                        detail_mask = parent.$('${/parameter/@winid}').wrap;
                        parent.Leaf.Masker.mask(detail_mask, '${l:HLS.LOADING}');
                    } else {
                        detail_mask = $('${/parameter/@winid}').wrap;
                        Leaf.Masker.mask(detail_mask, '${l:HLS.LOADING}');
                    }
                } else {
                    detail_mask = Ext.getBody();
                    Leaf.Masker.mask(detail_mask, '${l:HLS.LOADING}');
                }
            }
            
            
            function con500_contract_exit() {
                	$('${/parameter/@winid}').close();
            }
            
        ]]></script>
        <a:freeMarker><![CDATA[
	        	<#if model.getObject("/model/layout_main_button_path").getChilds()??>
	        		<#if model.getObject("/parameter/@tab_tab_code")??>
		        	<#else>
		        		<a:screenTopToolbar>
			        		<#list model.getObject('/model/layout_main_button_path').getChilds() as item>
				        			<#if item.getString('button_code') =='EXIT'>
				        				<a:gridButton click="con500_contract_exit" text="${item.getString('prompt')!""}"/>
				        			</#if>
			        		</#list>
		        		</a:screenTopToolbar>
		        	</#if>
	        	</#if>
	        ]]></a:freeMarker>
        <a:screenBody padding="5" style="width:98%">
            <a:placeHolder id="dynamicMain_id"/>
        </a:screenBody>
    </a:view>
    <a:view-config>
        <c:create-config targetId="dynamicMain_id">
            <p:loop source="/model/layout_main_path">
                <p:switch test="@tab_type">
                    <p:case value="FORM">
                        <c:process-config>
                            <a:screen-include screen="modules/cont/CON500/con_contract_update_form.lview?form_tab_code=${@tab_code}&amp;layout_code=${/parameter/@layout_code}&amp;document_id=${/parameter/@document_id}&amp;document_category=${/parameter/@document_category}&amp;document_type=${/parameter/@document_type}&amp;winid=${/parameter/@winid}&amp;function_code=${/parameter/@function_code}&amp;function_usage=${/parameter/@function_usage}&amp;maintain_type=${/parameter/@maintain_type}&amp;calc_type=${/parameter/@calc_type}&amp;default_value_dsid=${/parameter/@default_value_dsid}"/>
                        </c:process-config>
                    </p:case>
                    <p:case value="GRID">
                        <c:process-config>
                            <a:screen-include screen="modules/cont/CON500/con_contract_update_grid.lview?grid_tab_code=${@tab_code}&amp;layout_code=${/parameter/@layout_code}&amp;document_id=${/parameter/@document_id}&amp;document_category=${/parameter/@document_category}&amp;document_type=${/parameter/@document_type}&amp;winid=${/parameter/@winid}&amp;function_code=${/parameter/@function_code}&amp;function_usage=${/parameter/@function_usage}&amp;maintain_type=${/parameter/@maintain_type}&amp;calc_type=${/parameter/@calc_type}&amp;default_value_dsid=${/parameter/@default_value_dsid}"/>
                        </c:process-config>
                    </p:case>
                    <p:case value="TEXTAREA">
                        <c:process-config>
                            <a:screen-include screen="modules/cont/CON500/con_contract_update_textarea.lview?textarea_tab_code=${@tab_code}&amp;layout_code=${/parameter/@layout_code}&amp;document_id=${/parameter/@document_id}&amp;document_category=${/parameter/@document_category}&amp;document_type=${/parameter/@document_type}&amp;winid=${/parameter/@winid}&amp;function_code=${/parameter/@function_code}&amp;function_usage=${/parameter/@function_usage}&amp;maintain_type=${/parameter/@maintain_type}&amp;calc_type=${/parameter/@calc_type}&amp;default_value_dsid=${/parameter/@default_value_dsid}"/>
                        </c:process-config>
                    </p:case>
                    <p:case value="ATTACH">
                        <p:switch test="/parameter/@layout_code">
                            <p:case value="LENDING_OPERATIONS">
                                <c:process-config>
                                    <a:screen-include screen="modules/cont/CON500/con_contract_update_attach_lending.lview?attach_tab_code=${@tab_code}&amp;layout_code=${/parameter/@layout_code}&amp;document_id=${/parameter/@document_id}&amp;document_category=${/parameter/@document_category}&amp;document_type=${/parameter/@document_type}&amp;winid=${/parameter/@winid}&amp;function_code=${/parameter/@function_code}&amp;function_usage=${/parameter/@function_usage}&amp;maintain_type=${/parameter/@maintain_type}&amp;calc_type=${/parameter/@calc_type}&amp;cdd_list_id=${/parameter/@cdd_list_id}&amp;default_value_dsid=${/parameter/@default_value_dsid}"/>
                                </c:process-config>
                            </p:case>
                            <p:case value="*">
                                <c:process-config>
                                    <a:screen-include screen="modules/cont/CON500/con_contract_update_attach.lview?attach_tab_code=${@tab_code}&amp;layout_code=${/parameter/@layout_code}&amp;document_id=${/parameter/@document_id}&amp;document_category=${/parameter/@document_category}&amp;document_type=${/parameter/@document_type}&amp;winid=${/parameter/@winid}&amp;function_code=${/parameter/@function_code}&amp;function_usage=${/parameter/@function_usage}&amp;maintain_type=${/parameter/@maintain_type}&amp;calc_type=${/parameter/@calc_type}&amp;cdd_list_id=${/parameter/@cdd_list_id}&amp;default_value_dsid=${/parameter/@default_value_dsid}"/>
                                </c:process-config>
                            </p:case>
                        </p:switch>
                    </p:case>
                    <p:case value="TAB">
                        <c:process-config>
                            <a:screen-include screen="modules/cont/CON500/con_contract_update_tabpanel.lview?tab_group=${@tab_group}&amp;parent_tab_code=${/parameter/@tab_tab_code}&amp;layout_code=${/parameter/@layout_code}&amp;document_id=${/parameter/@document_id}&amp;document_category=${/parameter/@document_category}&amp;document_type=${/parameter/@document_type}&amp;winid=${/parameter/@winid}&amp;function_code=${/parameter/@function_code}&amp;function_usage=${/parameter/@function_usage}&amp;maintain_type=${/parameter/@maintain_type}&amp;calc_type=${/parameter/@calc_type}&amp;cdd_list_id=${/parameter/@cdd_list_id}&amp;default_value_dsid=${/parameter/@default_value_dsid}"/>
                        </c:process-config>
                    </p:case>
                </p:switch>
            </p:loop>
        </c:create-config>
    </a:view-config>
</a:screen>
