<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2014-12-9 下午1:51:49  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="item_detail_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <script type="text/javascript"><![CDATA[
			            
            window['${/parameter/@layout_code}_detail_upload_window']=function detail_upload_window(record_id,name) {
                if (Leaf.isEmpty(record_id)) {
                    Leaf.showMessage('提示', '请先保存再上传附件！');
                    return;
                }
                var url = $('item_detail_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT_ITEM_DETAIL&header_id=' + record_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'insurance_records_uploadFile_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {});
            };
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record,bp_seq) {
                var link_function = '${/parameter/@layout_code}_detail_upload_window';
                window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
                if (name=='attachment_upload') {
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.get('item_detail_id') + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
                }
            };            
	]]></script>
    </a:view>
</a:screen>
