<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[     
    ]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function queryTemplateCode(){
                $('fnd_interface_templates_result_ds').query();
            }
            function templateCodeEditor(record,name){
                if (record.isNew){
                    return 'fnd_interface_templates_grid_textField';
                }else{
                    return '';
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_interface_templates_query_ds" model="fnd.fnd_interface_templates"/>
            <a:dataSet id="fnd_interface_templates_result_ds" autoCreate="true" autoQuery="true" fetchAll="false" model="fnd.fnd_interface_templates" pageSize="15" queryDataSet="fnd_interface_templates_query_ds">
                <a:fields>
                    <a:field name="header_id"/>
                    <a:field name="template_code" required="true"/>
                    <a:field name="description"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="sorce_type"/>
                    <a:field name="execute_pkg"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form column="2" title="FND_INTERFACE_TEMPLATES.TEMPLATE_CODE_QUERY" width="500">
                <a:textField name="template_code" bindTarget="fnd_interface_templates_query_ds" typeCase="upper">
                    <a:events>
                        <a:event name="enterdown" handler="queryTemplateCode"/>
                    </a:events>
                </a:textField>
                <a:textField name="description" bindTarget="fnd_interface_templates_query_ds">
                    <a:events>
                        <a:event name="enterdown" handler="queryTemplateCode"/>
                    </a:events>
                </a:textField>
            </a:form>
            <a:hBox>
                <a:button click="queryTemplateCode" text="HAP_QUERY"/>
            </a:hBox>
            <a:grid id="fnd_interface_templates_grid" bindTarget="fnd_interface_templates_result_ds" marginHeight="150" marginWidth="40" navBar="true" width="800">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="clear"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="template_code" editor="fnd_interface_templates_grid_textField" editorFunction="templateCodeEditor" width="200"/>
                    <a:column name="description" editor="fnd_interface_templates_grid_textField" width="200"/>
                    <a:column name="enabled_flag" editor="fnd_interface_templates_grid_checkbox"/>
                    <a:column name="source_type" editor="fnd_interface_templates_grid_textField" width="100"/>
                    <a:column name="execute_pkg" editor="fnd_interface_templates_grid_textField" width="200"/>
                </a:columns>
                <a:editors>
                    <a:textField id="fnd_interface_templates_grid_textField"/>
                    <a:checkBox id="fnd_interface_templates_grid_checkbox"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>