<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Clocc  
    $Date: 2015-7-9 下午2:22:01  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <script type="text/javascript"><![CDATA[
    
    		// function rpt100_back() {
                // history.go(-1);
            // }
            
            function rpt100_query() {
                $('rpt_report_define_ds').query();
            }
            
            function rpt100_add() {
                $('rpt_report_define_grid').showEditorByRecord($('rpt_report_define_ds').create());
            }
            
            function rpt100_submit() {
                var result_ds = $('rpt_report_define_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            
            function rpt100_remove(){
                $('rpt_report_define_grid').remove();
            }
            
            
            function onChangeFun(ds,record,name,value,oldvalue){
                var regx = /^[0-9a-zA-Z_]*$/g;
	           if(name == 'rpt_name' && value){
	             if(!regx.test(value)){
					Leaf.showMessage('${l:PROMPT}', '输入类型有误,请重新输入!');

				 }
            	}	
            }

    ]]></script>
        <a:dataSets>
            <a:dataSet id="for_query_ds">
                <a:fields>
                    <a:field name="rpt_name"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="rpt_report_define_ds"  autoQuery="true" model="rpt.RPT100.rpt_report_define" queryDataSet="for_query_ds" selectable="true">
                <a:events>
                    <a:event name="update" handler="onChangeFun"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="rpt100_query" text="HLS.QUERY"/>
                <a:gridButton click="rpt100_add" text="HLS.NEW"/>
                <a:gridButton click="rpt100_remove" text="HLS.REMOVE"/>
                <a:gridButton click="rpt100_submit" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="1" marginWidth="200" title="查询条件">
                <a:textField name="rpt_name" bindTarget="for_query_ds" prompt="报表名称"/>
            </a:form>
            <a:grid id="rpt_report_define_grid" bindTarget="rpt_report_define_ds" marginHeight="180" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="rpt_name" id="rpt_name_id" editor="ln_grid_text" prompt="报表名称" width="200"/>
                    <a:column name="procedure_name" editor="ln_grid_text" prompt="过程名称" width="230"/>
                    <!-- <a:column name="input_table_name" editor="ln_grid_text" prompt="输入表名" width="180"/> -->
                    <a:column name="output_table_name" editor="ln_grid_text" prompt="输出表名" width="180"/>
                </a:columns>
                <a:editors>
                    <a:textField id="ln_grid_text"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>