Files
ofbiz-framework/framework/example/widget/example/FormWidgetExampleForms.xml
T
Jacques Le Roux 14adf43d86 * Especially fix a bug in fieldlookup.js.
When using description-field-name in a layered lookup called from another layered lookup (recursively or not) the description-field-name parameter (target2) in the call from the 2d lookup button was not modified, therefore the link was not working.

Miscellaneous:
* Format and fix some typos in fieldlookup.js
* Removes now useless commented out functions set_value and set_values in lookup.ftl
* Improves comments in FormWidgetExampleForms.xml


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@947392 13f79535-47bb-0310-9956-ffa450edef68
2010-05-23 10:08:21 +00:00

318 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="DateTimeFieldsExampleForm" type="single" title="">
<actions>
<set field="exampleDateField" value="${date:nowTimestamp()}" type="Timestamp"/>
</actions>
<!-- ***************** -->
<!-- *** field1 *** -->
<!-- ***************** -->
<field name="field1"
title="${uiLabelMap.ExampleDateField1Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<date-time/>
</field>
<!-- ***************** -->
<!-- *** field9 *** -->
<!-- ***************** -->
<field name="field9"
title="${uiLabelMap.ExampleDateField9Title}">
<!--tooltip="${uiLabelMap.ExampleDateField9Tooltip}"-->
<date-time default-value="${groovy:org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/>
</field>
<!-- ***************** -->
<!-- *** field10 *** -->
<!-- ***************** -->
<field name="field10"
title="${uiLabelMap.ExampleDateField10Title}"
tooltip="${uiLabelMap.ExampleDateField10Tooltip}">
<date-time default-value="${nowTimestamp}"/>
</field>
<!-- ***************** -->
<!-- *** field11 *** -->
<!-- ***************** -->
<field name="field11"
title="${uiLabelMap.ExampleDateField11Title}"
tooltip="${uiLabelMap.ExampleDateField11Tooltip}">
<date-time default-value="${date:dayStart(nowTimestamp, timeZone, locale)}"/>
</field>
<!-- ***************** -->
<!-- *** field2 *** -->
<!-- ***************** -->
<field name="field2"
title="${uiLabelMap.ExampleDateField2Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<date-time type="date"/>
</field>
<!-- ***************** -->
<!-- *** field3 *** -->
<!-- ***************** -->
<field name="field3"
title="${uiLabelMap.ExampleDateField3Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<date-time type="time"/>
</field>
<!-- ***************** -->
<!-- *** field4 *** -->
<!-- ***************** -->
<field name="field4"
title="${uiLabelMap.ExampleDateField4Title}"
tooltip="${uiLabelMap.ExampleDateField4Tooltip}">
<date-time input-method="time-dropdown" clock="24" default-value="${exampleDateField}"/>
</field>
<!-- ***************** -->
<!-- *** field5 *** -->
<!-- ***************** -->
<field name="field5"
title="${uiLabelMap.ExampleDateField5Title}"
tooltip="${uiLabelMap.ExampleDateField4Tooltip}">
<date-time input-method="time-dropdown" clock="12" default-value="${exampleDateField}"/>
</field>
<!-- ***************** -->
<!-- *** field6 *** -->
<!-- ***************** -->
<field name="field6"
entry-name="exampleDateField"
title="${uiLabelMap.ExampleDateField6Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<display/>
</field>
<!-- ***************** -->
<!-- *** field7 *** -->
<!-- ***************** -->
<field name="field7"
entry-name="exampleDateField"
title="${uiLabelMap.ExampleDateField7Title}"
tooltip="${uiLabelMap.ExampleDateField7Tooltip}">
<display description="${groovy:org.ofbiz.base.util.UtilDateTime.toDateString(exampleDateField, &quot;MM/dd/yyyy&quot;);}"/>
</field>
<!-- ***************** -->
<!-- *** field8 *** -->
<!-- ***************** -->
<field name="field8"
entry-name="exampleDateField"
title="${uiLabelMap.ExampleDateField8Title}"
tooltip="${uiLabelMap.ExampleDateField8Tooltip}">
<display description="${groovy:org.ofbiz.base.util.UtilDateTime.toDateString(exampleDateField, &quot;MMMM,dd,yyyy&quot;);}"/>
</field>
</form>
<form name="DropDownFieldsExampleForm" type="single" title="">
<field name="dropDownFields1" title="${uiLabelMap.ExampleDropDown}">
<display description="${uiLabelMap.ExampleDropDownTooltip}" also-hidden="false"/>
</field>
<!-- ***************** -->
<!-- *** field1 *** -->
<!-- ***************** -->
<field name="field1"
title="${uiLabelMap.ExampleDropDownField1Title}"
tooltip="${uiLabelMap.ExampleDropDownField1Tooltip}">
<drop-down allow-empty="true">
<option key="Y" description="${uiLabelMap.CommonY}"/>
<option key="N" description="${uiLabelMap.CommonN}"/>
</drop-down>
</field>
<!-- ***************** -->
<!-- *** field2 *** -->
<!-- ***************** -->
<field name="field2"
title="${uiLabelMap.ExampleDropDownField2Title}"
tooltip="${uiLabelMap.ExampleDropDownField2Tooltip}">
<drop-down allow-empty="false"> <!-- allow-empty="false" is also the default value, so you can also not specify this attribute here -->
<option key="Y" description="${uiLabelMap.CommonY}"/>
<option key="N" description="${uiLabelMap.CommonN}"/>
</drop-down>
</field>
<!-- ***************** -->
<!-- *** field5 *** -->
<!-- ***************** -->
<field name="field5"
title="${uiLabelMap.ExampleDropDownField5Title}"
tooltip="${uiLabelMap.ExampleDropDownField5Tooltip}">
<drop-down no-current-selected-key="N">
<option key="Y" description="${uiLabelMap.CommonY}"/>
<option key="N" description="${uiLabelMap.CommonN}"/>
</drop-down>
</field>
<!-- ***************** -->
<!-- *** field8 *** -->
<!-- ***************** -->
<field name="field8"
title="${uiLabelMap.ExampleDropDownField8Title}"
event="onchange"
action="return alert('You have changed the value in the select box');"
tooltip="${uiLabelMap.ExampleDropDownField8Tooltip}">
<drop-down>
<option key="Y" description="${uiLabelMap.CommonY}"/>
<option key="N" description="${uiLabelMap.CommonN}"/>
</drop-down>
</field>
<field name="entityOptionsFields1" title="${uiLabelMap.ExampleDropDownEntityOptions}"><display description="${uiLabelMap.ExampleDropDownEntityOptionsTooltip1}" also-hidden="false"/></field>
<field name="entityOptionsFields2" title="${uiLabelMap.CommonEmptyHeader}"><display description="${uiLabelMap.ExampleDropDownEntityOptionsTooltip2}" also-hidden="false"/></field>
<field name="entityOptionsFields3" title="${uiLabelMap.CommonEmptyHeader}"><display description="${uiLabelMap.ExampleDropDownEntityOptionsTooltip3}" also-hidden="false"/></field>
<!-- ***************** -->
<!-- *** field3 *** -->
<!-- ***************** -->
<field name="field3"
title="${uiLabelMap.ExampleDropDownField3Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<drop-down>
<entity-options entity-name="ExampleType"
key-field-name="exampleTypeId"
description="${description}">
<entity-order-by field-name="-description"/>
</entity-options>
</drop-down>
</field>
<!-- ***************** -->
<!-- *** field4 *** -->
<!-- ***************** -->
<field name="field4"
title="${uiLabelMap.ExampleDropDownField4Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<drop-down>
<entity-options entity-name="ExampleType"
key-field-name="exampleTypeId"
description="${exampleTypeId} - ${description}">
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
<!-- ***************** -->
<!-- *** field6 *** -->
<!-- ***************** -->
<field name="exampleTypeId"
title="${uiLabelMap.ExampleDropDownField6Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<drop-down>
<entity-options entity-name="ExampleType"
description="${description}"/>
</drop-down>
</field>
<!-- ***************** -->
<!-- *** field7 *** -->
<!-- ***************** -->
<field name="field7"
title="${uiLabelMap.ExampleDropDownField7Title}"
tooltip="${uiLabelMap.ExampleToDo}">
<drop-down>
<entity-options entity-name="ExampleType"
key-field-name="exampleTypeId"
description="${description}">
<entity-constraint name="exampleTypeId"
value="INSPIRED"
operator="greater"/>
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
</field>
</form>
<!-- Simple form to print a FOP PDF file with the fonts available in OFBiz Project -->
<form name="FOPFontsExampleForm" type="single" target="printExampleFOPFonts">
<field name="printButton" title="${uiLabelMap.ExamplePrintButton}" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<form name="FieldGroupExampleForm" type="single" title="">
<field name="field1" title="${uiLabelMap.ExampleField} 1"><text/></field>
<field name="field2" title="${uiLabelMap.ExampleField} 2"><text/></field>
<field name="field3" title="${uiLabelMap.ExampleField} 3"><text/></field>
<field name="field4" title="${uiLabelMap.ExampleField} 4"><text/></field>
<field name="field5" title="${uiLabelMap.ExampleField} 5"><text/></field>
<field name="field6" title="${uiLabelMap.ExampleField} 6"><text/></field>
<field name="field7" title="${uiLabelMap.ExampleField} 7"><text/></field>
<field name="field8" title="${uiLabelMap.ExampleField} 8"><text/></field>
<field name="field9" title="${uiLabelMap.ExampleField} 9"><text/></field>
<field name="field10" title="${uiLabelMap.ExampleField} 10"><text/></field>
<field name="field11" title="${uiLabelMap.ExampleField} 11"><text/></field>
<field name="field12" title="${uiLabelMap.ExampleField} 12"><text/></field>
<field name="field13" title="${uiLabelMap.ExampleField} 13"><text/></field>
<field name="field14" title="${uiLabelMap.ExampleField} 14"><text/></field>
<field name="field14" title="${uiLabelMap.ExampleField} 15"><text/></field>
<sort-order>
<field-group title="${uiLabelMap.ExampleGroupField} 1" collapsible="true" initially-collapsed="true">
<sort-field name="field1"/>
<sort-field name="field2"/>
<sort-field name="field3"/>
<sort-field name="field4"/>
<sort-field name="field5"/>
</field-group>
<field-group title="${uiLabelMap.ExampleGroupField} 2" collapsible="true">
<sort-field name="field6"/>
<sort-field name="field7"/>
<sort-field name="field8"/>
<sort-field name="field9"/>
<sort-field name="field10"/>
</field-group>
<field-group title="${uiLabelMap.ExampleGroupField} 3">
<sort-field name="field11"/>
<sort-field name="field12"/>
<sort-field name="field13"/>
<sort-field name="field14"/>
<sort-field name="field15"/>
</field-group>
</sort-order>
</form>
<!-- Lookup Layer Example -->
<form name="ExampleLookupFields" type="single" title="">
<!-- Old style lookup (in a popup window) -->
<!-- Using separated labels is not recommended (it's better using sentences than words for translation) -->
<field name="partyIdFrom" title="${uiLabelMap.CommonPartyID} ${uiLabelMap.CommonFrom}"><!-- we use partyIdFrom here only to differentiate from the other partyId field we use below, ie partyIdTo-->
<lookup target-form-name="LookupPartyExample" presentation="window"/>
</field>
<!-- Standard lookup (in a layer)-->
<!-- passes the name in one and the id in another field -->
<field name="partyName" title="${uiLabelMap.CommonName}">
<lookup target-form-name="LookupPartyExampleByName" description-field-name="partyIdTo"/>
</field>
<!-- This field may be hidden and the name rendered in partyName using default-value if partyIdTo exists-->
<field name="partyIdTo" title="${uiLabelMap.CommonPartyID} ${uiLabelMap.CommonTo}"><text/></field><!-- the text field is only used for rendering. In the "real life" you would use the hidden fiels commented below to pass the data to the request -->
<!--field name="partyIdTo"><hidden/></field-->
<sort-order>
<field-group>
<sort-field name="partyIdFrom"/>
</field-group>
<field-group>
<sort-field name="partyName"/>
<sort-field name="partyIdTo"/>
</field-group>
</sort-order>
</form>
<form name="SelectionBoxesExampleForm" type="single">
<field name="ExampleTypeId">
<check>
<entity-options key-field-name="exampleTypeId" description="${description}" entity-name="ExampleType"/>
</check>
</field>
</form>
</forms>