Files
ofbiz-framework/framework/example/widget/example/ExampleForms.xml
T
Jacques Le Roux 48c6114143 A patch from Nicolas Malin "Add famfamfam icons has generic and add possibility to surchage" https://issues.apache.org/jira/browse/OFBIZ-4259
Adds the possibility to use famfamfam icons contained in framework/images/webapp/images/famfamfam/icons.
If you want use a specific icon, it's possible to define an attribute VT_ICONS_LOC that contains the location to themes icons directory to use
It improves form rendering to pass a flexible string on image-location attribute and screen and form renderer to display an image with a text.

JLR: I just added à   before menus texts

After Erwan's remark I wondered If I should remove the CSS on buttons. But I finally found that it was complementary. Because when no image is used on a specific button you still have the default CSS style applied (typical for Add buttons as Erwan outlined). And when no default CSS style is applied you can have an image like now shown OTTB on print button when editing an Example. So I see these 2 features as complementary for now. Maybe one day, one will replace the other, but at this stage both are welcome IMO.

BTW the famfamfam (strange name ;o) icons lib is well done and really full of possibilities...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1095984 13f79535-47bb-0310-9956-ffa450edef68
2011-04-22 18:51:10 +00:00

252 lines
15 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" image-location="/images/icons/magnifier.png"/></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="&quot;EXST_APPROVED&quot;.equals(statusId)" style="Validate"/>
<alt-row-style use-when="&quot;EXST_CANCELLED&quot;.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(&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"/>
<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"/--><!-- JLR: this does not seem to be useful -->
</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="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
<hyperlink target="deleteExampleItem" description="${uiLabelMap.CommonDelete}" also-hidden="false" confirmation-message="${uiLabelMap.CommonConfirmDelete}" image-location="${iconsLocation}/delete.png">
<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="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
<hyperlink target="example_deleteExampleFeatureAppl" description="${uiLabelMap.CommonDelete}" also-hidden="false" image-location="${iconsLocation}/delete.png">
<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>
<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>