Files
ofbiz-framework/framework/example/widget/example/ExampleForms.xml
T
Adrian Crum 2d89f0f365 Form widget Ajax refinements.
Changed attribute-based ajax calls to on-event-update-area elements. Fixed bug in autocomplete. Cleaned up some of the rendering code.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@661450 13f79535-47bb-0310-9956-ffa450edef68
2008-05-29 19:48:24 +00:00

192 lines
11 KiB
XML

<?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="ListExamples" type="list" list-name="examples" paginate-target="FindExample">
<actions>
<entity-condition entity-name="Example"><order-by field-name="exampleName"/></entity-condition>
</actions>
<field name="exampleId" title="${uiLabelMap.ExampleExampleId}" widget-style="buttontext">
<hyperlink also-hidden="false" description="${exampleId}" target="EditExample?exampleId=${exampleId}"/>
</field>
<field name="exampleName" title="${uiLabelMap.CommonName}"><display/></field>
<field name="exampleTypeId" title="${uiLabelMap.CommonType}"><display-entity entity-name="ExampleType"/></field>
<field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
<field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
</form>
<!-- Typically, this extended form wouldn't be necessary. The parent form (ListExamples) would
have these attributes. -->
<form name="ListExamplesAjax" extends="ListExamples" type="list" paginate-target="authview/findExampleAjax">
<on-event-update-area event-type="paginate" area-id="ListExamplesAjax" area-target="ListExampleFormOnly"/>
</form>
<form name="EditExample" type="single" target="updateExample" title="" default-map-name="example">
<actions>
<entity-one entity-name="StatusItem" value-name="currentStatus" auto-field-map="false">
<field-map field-name="statusId" env-name="example.statusId"/>
</entity-one>
</actions>
<alt-target use-when="example==null" target="createExample"/>
<auto-fields-service service-name="updateExample"/>
<field use-when="example!=null" name="exampleId" title="${uiLabelMap.ExampleExampleId}" tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
<field use-when="example==null&amp;&amp;exampleId==null" name="exampleId" title="${uiLabelMap.ExampleExampleId}"><ignored/></field>
<field use-when="example==null&amp;&amp;exampleId!=null" name="exampleId" title="${uiLabelMap.ExampleExampleId}"><display description="${uiLabelMap.CommonCannotBeFound}: [${exampleId}]" also-hidden="false"/></field>
<field name="exampleTypeId" title="${uiLabelMap.CommonType}">
<drop-down allow-empty="false">
<entity-options entity-name="ExampleType" description="${description}">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="statusId" use-when="example==null" title="${uiLabelMap.CommonStatus}">
<drop-down allow-empty="false">
<entity-options entity-name="StatusItem" description="${description}">
<entity-constraint name="statusTypeId" value="EXAMPLE_STATUS"/>
<entity-order-by field-name="sequenceId"/>
</entity-options>
</drop-down>
</field>
<field name="statusId" use-when="example!=null" title="${uiLabelMap.CommonStatus}">
<drop-down allow-empty="false" current-description="${currentStatus.description}">
<entity-options entity-name="StatusValidChangeToDetail" key-field-name="statusIdTo" description="${transitionName} (${description})">
<entity-constraint name="statusId" env-name="example.statusId"/>
<entity-order-by field-name="sequenceId"/>
</entity-options>
</drop-down>
</field>
<field name="description" title="${uiLabelMap.CommonDescription}"/>
<field name="anotherText">
<drop-down allow-empty="true">
<option key="Explicit Option" description="${uiLabelMap.ExampleExplicitOption}"/>
<entity-options entity-name="ProductType" description="${description}" key-field-name="description">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="displayAnotherText" use-when="example!=null&amp;&amp;example.get(&quot;anotherText&quot;)!=null">
<display description="${example.anotherText}"/>
</field>
<field name="submitButton" use-when="example==null" title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
<field name="submitButton" use-when="example!=null" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
</form>
<!-- Typically, this extended form wouldn't be necessary. The parent form (EditExample) would
have these settings. -->
<form name="EditExampleBackgroundSubmit" type="single" extends="EditExample" target="updateExampleAjax">
<alt-target use-when="example==null" target="createExampleAjax"/>
<on-event-update-area event-type="submit" area-id="ListExamplesAjax" area-target="ListExampleFormOnly"/>
<on-event-update-area event-type="submit" area-id="EditExampleAjax" area-target="CreateExampleFormOnly"/>
</form>
<!-- ExampleItem -->
<form name="ListExampleItems" type="list" list-name="exampleItems" target="updateExampleItem">
<actions>
<entity-condition entity-name="ExampleItem">
<condition-expr field-name="exampleId" env-name="exampleId"/>
<order-by field-name="exampleItemSeqId"/>
</entity-condition>
</actions>
<auto-fields-service service-name="updateExampleItem"/>
<field name="exampleId"><hidden/></field>
<field name="exampleItemSeqId" title="${uiLabelMap.CommonItem}"><display/></field>
<field name="description"><text size="30"/></field>
<field name="amountUomId" title="${uiLabelMap.CommonUom}">
<drop-down allow-empty="true">
<entity-options entity-name="UomAndType" key-field-name="uomId" description="${typeDescription}: ${description} (${abbreviation})">
<entity-order-by field-name="typeDescription"/>
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="deleteLink" title="" widget-style="buttontext">
<hyperlink target="deleteExampleItem?exampleId=${exampleId}&amp;exampleItemSeqId=${exampleItemSeqId}"
description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
</field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
</form>
<form name="AddExampleItem" type="single" target="createExampleItem" title="">
<auto-fields-service service-name="createExampleItem"/>
<field name="exampleId"><hidden/></field>
<field name="exampleItemSeqId"><ignored/><!-- this will be auto-sequenced --></field>
<field name="amountUomId" title="${uiLabelMap.CommonUom}">
<drop-down allow-empty="true">
<entity-options entity-name="UomAndType" key-field-name="uomId" description="${typeDescription}: ${description} (${abbreviation})">
<entity-order-by field-name="typeDescription"/>
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
</form>
<!-- ExampleFeatureAppl -->
<form name="ListExampleFeatureAppls" type="list" list-name="exampleFeatureAppls" target="example_updateExampleFeatureAppl">
<actions>
<entity-condition entity-name="ExampleFeatureAppl">
<condition-expr field-name="exampleId" env-name="exampleId"/>
<order-by field-name="sequenceNum"/>
</entity-condition>
</actions>
<auto-fields-service service-name="updateExampleFeatureAppl"/>
<field name="exampleId"><hidden/></field>
<field name="exampleFeatureId" title="${uiLabelMap.ExampleFeature}">
<display-entity entity-name="ExampleFeature" description="${description}">
<sub-hyperlink target="EditExampleFeature?exampleFeatureId=${exampleFeatureId}" description="${exampleFeatureId}" link-style="buttontext"/>
</display-entity>
</field>
<field name="fromDate"><display/></field>
<field name="exampleFeatureApplTypeId" title="${uiLabelMap.CommonType}">
<drop-down allow-empty="false">
<entity-options entity-name="ExampleFeatureApplType" description="${description}">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
<field name="deleteLink" title="" widget-style="buttontext">
<hyperlink target="example_deleteExampleFeatureAppl?exampleId=${exampleId}&amp;exampleFeatureId=${exampleFeatureId}&amp;fromDate=${fromDate}"
description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
</field>
</form>
<form name="AddExampleFeatureAppl" type="single" target="example_createExampleFeatureAppl" title="">
<auto-fields-service service-name="createExampleFeatureAppl"/>
<field name="exampleId"><hidden/></field>
<field name="exampleFeatureId" id-name="exampleFeatureId">
<text/>
<on-field-event-update-area event-type="change" area-id="exampleFeatureId" area-target="findExampleFeatures"/>
</field>
<!-- <field name="exampleFeatureId" title="${uiLabelMap.ExampleFeature}" id-name="exampleFeatureId"><lookup target-form-name="LookupExampleFeature"/></field> -->
<field name="exampleFeatureApplTypeId" title="${uiLabelMap.CommonType}">
<drop-down allow-empty="false">
<entity-options entity-name="ExampleFeatureApplType" description="${description}">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
</form>
</forms>