ilscipio/scipio-erp

View on GitHub
framework/webtools/widget/GeoManagementForms.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
-->

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">

    <form name="FindGeo" id="FindGeo" target="${currentUrl}" extends="LookupGeo" extends-resource="component://common/widget/LookupForms.xml"/>        
    
    <form name="ListGeos" extends-resource="component://common/widget/LookupForms.xml" extends="listLookupGeo" paginate-target="${currentUrl}"
        odd-row-style="alternate-row" header-row-style="header-row-2" separate-columns="true" > <!-- orig: default-table-style=-style="basic-table hover-bar" -->
        <field name="geoId" widget-style="${styles.link_nav_info_id}" title="${uiLabelMap.CommonGeoId}">
            <hyperlink also-hidden="false" target-type="plain" description="${geoId}" target="EditGeo">
                <parameter param-name="geoId"/>
            </hyperlink>
        </field>
        <field name="wellKnownText" title="${uiLabelMap.CommonGeoWellKnownText}"><display/></field>
        <field name="deleteAction" title=" " widget-style="${styles.link_run_sys} ${styles.action_remove}">
            <hyperlink target="deleteGeo" description="${uiLabelMap.CommonRemove}">
                <parameter param-name="geoId"/>
                <parameter param-name="noConditionFind" value="Y"/>
            </hyperlink>
        </field>
    </form>
    
    <form name="EditGeo" type="single" target="updateGeo" title="" default-map-name="geo"
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <alt-target use-when="geo==null" target="createGeo"/>
        <field name="geoId" title="${uiLabelMap.CommonGeoId}"><text/></field>
        <field name="geoTypeId" title="${uiLabelMap.CommonGeoTypeId}">
            <drop-down allow-empty="true">
                <entity-options key-field-name="geoTypeId" entity-name="GeoType" description="${description}">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="geoName" title="${uiLabelMap.CommonGeoName}"><text/></field>
        <field name="geoCode" title="${uiLabelMap.CommonGeoCode}"><text/></field>
        <field name="geoSecCode" title="${uiLabelMap.CommonGeoSecCode}"><text/></field>
        <field name="abbreviation" title="${uiLabelMap.CommonGeoAbbr}"><text/></field>
        <field name="wellKnownText" title="${uiLabelMap.CommonGeoWellKnownText}"><textarea/></field>
        <field name="submitAction" title="${uiLabelMap.CommonSubmit}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
    </form>
    <form name="ListLookupGeo" extends="ListGeos">
        <field name="geoId" title="${uiLabelMap.CommonGeoId}" widget-style="${styles.link_nav_info_id}">
            <hyperlink also-hidden="false" target-type="plain" description="${geoId}" target="javascript:set_value('${geoId}')"/>
        </field>
        <field name="deleteAction"><ignored/></field>
    </form>
    
    <form name="LinkGeos" type="single" target="linkGeos" title="" focus-field-name="geoId" 
        header-row-style="header-row"> <!-- orig: default-table-style=-style="basic-table" -->
        <field name="geoIds" title="${uiLabelMap.CommonGeos}">
            <!-- SCIPIO: FIXME?: without entity-constraint, this drop-down may produce too many entries... but the JS doesn't allow us to change this yet... -->
            <drop-down allow-multiple="true">
                <entity-options entity-name="Geo" key-field-name="geoId" description="${geoName} (${geoId})">
<!--                    <entity-constraint name="geoTypeId" operator="in" value="STATE,PROVINCE,REGIONS"/><!-\- useful to quickly test -\->-->
                    <entity-order-by field-name="geoId"/>
                </entity-options>
            </drop-down>
        </field>        
        <field name="dummy" title=" "><display/></field>
        <field name="geoAssocTypeId" title="${uiLabelMap.CommonGeoAssocTypeId}"
            event="onChange" 
            action="typeValue = jQuery('#${asm_typeField}').val(); selectMultipleRelatedValues('${asm_requestName}', '${asm_paramKey}', '${asm_relatedField}', '${asm_multipleSelect}', '${asm_type}', typeValue, '${asm_responseName}');">
            <drop-down>
                <entity-options key-field-name="geoAssocTypeId" entity-name="GeoAssocType" description="${description}">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="geoId" title="${uiLabelMap.CommonGeo}">
            <!-- SCIPIO: FIXME?: without entity-constraint, this drop-down may produce too many entries... but the JS doesn't allow us to change this yet... -->
            <drop-down current="selected">
                <entity-options entity-name="Geo" key-field-name="geoId" description="${geoName} (${geoId})">
                    <entity-order-by field-name="geoId"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="submitAction" title="${uiLabelMap.CommonSubmit}" widget-style="${styles.link_run_sys} ${styles.action_update}"><submit button-type="button"/></field>
    </form>
        
</forms>