I began to clean and make things consistent for lookups (in order to demonstrate the new Name/id mechanism) but then I realized that it should use Example entity and not Party. I will change that later and will remove all out-of-framework dependencies in the Example component * I have added an example of the new Name/id mechanism * I removed deprecated snippets in ExampleForms (some were already commented out) and used rather LookupExampleFeature enhanced with autocomplete * In FormWidgetExampleForms.xml I tried to clean things for the autocomplete in the 1st lookup, but I thing there is an issue when more than one name field is retrieved. It does not behave consistently, try for a Person and a PartyGroup for instance... git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@993527 13f79535-47bb-0310-9956-ffa450edef68
264 lines
16 KiB
XML
264 lines
16 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="FindExamples" type="single" target="FindExample" default-entity-name="Example">
|
|
<field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
|
|
<field name="exampleId" title="${uiLabelMap.ExampleExampleId}"><text-find/></field>
|
|
<field name="exampleName" title="${uiLabelMap.CommonName}"><text-find/></field>
|
|
<field name="exampleTypeId" title="${uiLabelMap.CommonType}">
|
|
<drop-down allow-empty="true" current-description="">
|
|
<entity-options description="${description}" key-field-name="exampleTypeId" entity-name="ExampleType">
|
|
<entity-order-by field-name="description"/>
|
|
</entity-options>
|
|
</drop-down>
|
|
</field>
|
|
<field name="statusId" title="${uiLabelMap.CommonStatus}">
|
|
<drop-down allow-empty="true" current-description="">
|
|
<entity-options description="${description}" key-field-name="statusId" entity-name="ExampleStatusItem"/>
|
|
</drop-down>
|
|
</field>
|
|
<field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
|
|
</form>
|
|
|
|
<form name="ListExamples" type="list" list-name="listIt" paginate-target="FindExample" default-entity-name="Example" separate-columns="true"
|
|
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
|
|
<actions>
|
|
<service service-name="performFind" result-map="result" result-map-list="listIt">
|
|
<field-map field-name="inputFields" from-field="exampleCtx"/>
|
|
<field-map field-name="entityName" value="Example"/>
|
|
<field-map field-name="orderBy" from-field="parameters.sortField"/>
|
|
<field-map field-name="viewIndex" from-field="viewIndex"/>
|
|
<field-map field-name="viewSize" from-field="viewSize"/>
|
|
</service>
|
|
</actions>
|
|
<alt-row-style use-when=""EXST_APPROVED".equals(statusId)" style="Validate"/>
|
|
<alt-row-style use-when=""EXST_CANCELLED".equals(statusId)" style="Warn"/>
|
|
<field name="exampleId" title="${uiLabelMap.ExampleExampleId}" widget-style="buttontext">
|
|
<hyperlink also-hidden="false" description="${exampleId}" target="EditExample">
|
|
<parameter param-name="exampleId"/>
|
|
</hyperlink>
|
|
</field>
|
|
<field name="exampleName" title="${uiLabelMap.CommonName}" sort-field="true"><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}" sort-field="true"><display/></field>
|
|
</form>
|
|
|
|
<!-- Typically, this extended form wouldn't be necessary. The parent form (ListExamples) would
|
|
have these attributes.
|
|
For the Ajax example we want all example entities listed, so the we use the entity-condition
|
|
instead of the performFind service. -->
|
|
<form name="ListExamplesAjax" extends="ListExamples" type="list" paginate-target="authview/findExampleAjax">
|
|
<actions>
|
|
<entity-condition entity-name="Example"><order-by field-name="exampleName"/></entity-condition>
|
|
</actions>
|
|
<field name="exampleName" title="${uiLabelMap.CommonName}" id-name="exampleName">
|
|
<display>
|
|
<in-place-editor url="/example/control/updateExample" cancel-control="button" saving-text="Updating..." text-between-controls=" ">
|
|
<simple-editor/>
|
|
<field-map field-name="exampleId" from-field="exampleId"/>
|
|
<field-map field-name="statusId" from-field="statusId"/>
|
|
</in-place-editor>
|
|
</display>
|
|
</field>
|
|
<field name="description" title="${uiLabelMap.CommonDescription}" id-name="description">
|
|
<display>
|
|
<in-place-editor url="/example/control/updateExample" cancel-control="button" saving-text="Updating..." text-between-controls=" ">
|
|
<simple-editor/>
|
|
<field-map field-name="exampleId" from-field="exampleId"/>
|
|
<field-map field-name="statusId" from-field="statusId"/>
|
|
</in-place-editor>
|
|
</display>
|
|
</field>
|
|
<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" default-entity-name="Example">
|
|
<actions>
|
|
<entity-one entity-name="StatusItem" value-field="currentStatus" auto-field-map="false">
|
|
<field-map field-name="statusId" from-field="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 @and exampleId==null" name="exampleId" title="${uiLabelMap.ExampleExampleId}"><ignored/></field>
|
|
<field use-when="example==null @and exampleId!=null" name="exampleId" title="${uiLabelMap.ExampleExampleId}"><display description="${uiLabelMap.CommonCannotBeFound}: [${exampleId}]" also-hidden="false"/></field>
|
|
<field name="exampleTypeId" title="${uiLabelMap.CommonType}" id-name="exampleTypeId">
|
|
<drop-down allow-empty="false">
|
|
<!-- this is a neat feature, but not good for the type because the user would have to know the possible types in order to enter at least the first letter, so leaving it out by default; just uncomment to enable: <auto-complete/> -->
|
|
<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="ExampleStatusItem" description="${description}"/>
|
|
</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-options>
|
|
</drop-down>
|
|
</field>
|
|
<field name="description" title="${uiLabelMap.CommonDescription}"/>
|
|
<field name="longDescription" title="${uiLabelMap.ExampleLongDescription}"/>
|
|
<field name="anotherText">
|
|
<drop-down allow-empty="true">
|
|
<option key="Explicit Option" description="${uiLabelMap.ExampleExplicitOption}"/>
|
|
<entity-options entity-name="ExampleType" description="${description}" key-field-name="exampleTypeId">
|
|
<entity-order-by field-name="description"/>
|
|
</entity-options>
|
|
</drop-down>
|
|
</field>
|
|
<field name="displayAnotherText" use-when="example!=null @and example.get("anotherText")!=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"/>
|
|
<field name="statusId" use-when="example==null" title="${uiLabelMap.CommonStatus}" id-name="statusId">
|
|
<drop-down allow-empty="false">
|
|
<entity-options entity-name="ExampleStatusItem" description="${description}"/>
|
|
</drop-down>
|
|
</field>
|
|
<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" from-field="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" description="${uiLabelMap.CommonDelete}" also-hidden="false" confirmation-message="${uiLabelMap.CommonConfirmDelete}">
|
|
<parameter param-name="exampleId"/>
|
|
<parameter param-name="exampleItemSeqId"/>
|
|
</hyperlink>
|
|
</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" request-confirmation="true"/></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" from-field="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" description="${exampleFeatureId}" link-style="buttontext">
|
|
<parameter param-name="exampleFeatureId"/>
|
|
</sub-hyperlink>
|
|
</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" description="${uiLabelMap.CommonDelete}" also-hidden="false">
|
|
<parameter param-name="exampleId"/>
|
|
<parameter param-name="exampleFeatureId"/>
|
|
<parameter param-name="fromDate"/>
|
|
</hyperlink>
|
|
</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" title="${uiLabelMap.ExampleFeature}">
|
|
<lookup target-form-name="LookupExampleFeature"/>
|
|
</field>
|
|
<!-- most feature rich for autocomplete, ie partial text entry searches the full string,
|
|
doesn't require custom request to function, etc; Note that for usability this is still a bit lame since you can't see the full list,
|
|
you HAVE to know part of the ID or description in order to see options -->
|
|
<!--field name="exampleFeatureId">
|
|
<drop-down>
|
|
<auto-complete/>
|
|
<entity-options entity-name="ExampleFeature" description="${exampleFeatureId}: ${description}">
|
|
<entity-order-by field-name="exampleFeatureId"/>
|
|
</entity-options>
|
|
</drop-down>
|
|
</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>
|