<?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 queryFieldCode(){
                $('fnd_sap_fields_result_ds').query();
            }
            function fieldCodeEditor(record,name){
                if (record.isNew){
                    return 'fnd_sap_fields_grid_textField';
                }else{
                    return '';
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_sap_fields_query_ds" model="fnd.fnd_sap_fields"/>
            <a:dataSet id="fnd_sap_fields_result_ds" autoCreate="true" autoQuery="true" fetchAll="false" model="fnd.fnd_sap_fields" pageSize="15" queryDataSet="fnd_sap_fields_query_ds">
                <a:fields>
                    <a:field name="field_id"/>
                    <a:field name="segmenttyp"/>
                    <a:field name="fieldname"/>
                    <a:field name="field_index"/>
                    <a:field name="intlen"/>
                    <a:field name="extlen"/>
                    <a:field name="field_pos"/>
                    <a:field name="byte_first"/>
                    <a:field name="byte_last"/>
                    <a:field name="rollname"/>
                    <a:field name="domname"/>
                    <a:field name="datatype"/>
                    <a:field name="descrp"/>
                    <a:field name="isocode"/>
                    <a:field name="valuetab"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form column="2" title="fnd_sap_fields.TEMPLATE_CODE_QUERY" width="500">
                <a:textField name="segmenttyp" bindTarget="fnd_sap_fields_query_ds">
                    <a:events>
                        <a:event name="enterdown" handler="queryFieldCode"/>
                    </a:events>
                </a:textField>
                <a:textField name="fieldname" bindTarget="fnd_sap_fields_query_ds" typeCase="upper">
                    <a:events>
                        <a:event name="enterdown" handler="queryFieldCode"/>
                    </a:events>
                </a:textField>
            </a:form>
            <a:hBox>
                <a:button click="queryFieldCode" text="HAP_QUERY"/>
            </a:hBox>
            <a:grid id="fnd_sap_fields_grid" bindTarget="fnd_sap_fields_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="segmenttyp" editor="fnd_sap_fields_grid_textField" editorFunction="fieldCodeEditor" width="200"/>
                    <a:column name="fieldname" editor="fnd_sap_fields_grid_textField" editorFunction="fieldCodeEditor" width="200"/>
                    <a:column name="field_index" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="intlen" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="extlen" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="field_pos" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="byte_first" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="byte_last" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="rollname" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="domname" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="datatype" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="descrp" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="isocode" editor="fnd_sap_fields_grid_textField" width="200"/>
                    <a:column name="valuetab" editor="fnd_sap_fields_grid_textField" width="200"/>
                </a:columns>
                <a:editors>
                    <a:textField id="fnd_sap_fields_grid_textField"/>
                    <a:checkBox id="fnd_sap_fields_grid_checkbox"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>