UI work in the Example and ExampleExt components. Fixed minor layout issues, tested with Firefox and IE7, formatted the screen widget XML files so they have consistent line spacing, and added some comments to help new users.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@653865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian Crum
2008-05-06 18:12:46 +00:00
parent 1250513a38
commit efe9694fb8
13 changed files with 84 additions and 60 deletions
@@ -20,13 +20,19 @@ under the License.
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="main-decorator">
<!-- The main-decorator screen 'wraps' or 'decorates' all of the screens in the
Example component. It is also decorated - by the GlobalDecorator screen. -->
<section>
<actions>
<!-- base/top/specific map first, then more common map added for shared labels -->
<!-- base/top/most specific map first, then more common map added for shared labels.
Setting things up this way enables a component to redefine the more common
UI labels. -->
<property-map resource="ExampleUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<!-- The layoutSettings field is a Map that is used to pass variables and layout
information to the GlobalDecorator and any templates that it uses. -->
<set field="layoutSettings.companyName" from-field="uiLabelMap.ExampleCompanyName" global="true"/>
<set field="layoutSettings.companySubtitle" from-field="uiLabelMap.ExampleCompanySubtitle" global="true"/>
<!-- layoutSettings.headerImageUrl can be used to specify an application specific logo; if not set,
@@ -45,10 +51,14 @@ under the License.
</screen>
<screen name="CommonExampleDecorator">
<!-- The CommonExampleDecorator screen decorates a small group of screens that all have
something in common. It is decorated by the main-decorator screen. To see how the
various decorators are combined to build a screen, view the page source of any
Example component screen. HTML comments indicate the start and end points of each
screen and decorator. -->
<section>
<actions>
<set field="headerItem" value="Example"/>
<set field="exampleId" from-field="parameters.exampleId"/>
<entity-one entity-name="Example" value-name="example"/>
</actions>
@@ -79,11 +89,13 @@ under the License.
<not><if-empty field-name="example"/></not>
</condition>
<widgets>
<container style="h1"><label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} "${example.exampleName}" [${exampleId}]</label></container>
<container style="h1"><label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} ${example.exampleName} [${exampleId}]</label></container>
<container style="button-bar"><link target="EditExample" text="${uiLabelMap.ExampleNewExample}" style="buttontext"/></container>
</widgets>
<fail-widgets>
<container style="h1"><label>${uiLabelMap.ExampleNewExample}</label></container>
</fail-widgets>
</section>
<decorator-section-include name="body"/>
</widgets>
<fail-widgets>
@@ -95,11 +107,11 @@ under the License.
</widgets>
</section>
</screen>
<screen name="CommonExampleFeatureDecorator">
<section>
<actions>
<set field="headerItem" value="ExampleFeature"/>
<set field="exampleFeatureId" from-field="parameters.exampleFeatureId"/>
<entity-one entity-name="ExampleFeature" value-name="exampleFeature"/>
</actions>
@@ -131,14 +143,16 @@ under the License.
</condition>
<widgets>
<container style="h1">
<label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} "${exampleFeature.description}" [${exampleFeatureId}]</label>
<label>${uiLabelMap.${titleProperty}} ${uiLabelMap.CommonFor} ${exampleFeature.description} [${exampleFeatureId}]</label>
</container>
<container style="button-bar">
<link target="EditExampleFeature" text="${uiLabelMap.ExampleNewExampleFeature}" style="buttontext"/>
</container>
</widgets>
<fail-widgets>
<container style="h1"><label>${uiLabelMap.ExampleNewExampleFeature}</label></container>
</fail-widgets>
</section>
<decorator-section-include name="body"/>
</widgets>
<fail-widgets>
@@ -150,30 +164,28 @@ under the License.
</widgets>
</section>
</screen>
<screen name="main">
<!-- This is the screen for the Main page in the Example component. A common pattern
in OFBiz is to have each component include a Main page as a starting point for
the user. -->
<section>
<widgets>
<decorator-screen name="main-decorator">
<decorator-section name="body">
<container style="screenlet">
<container style="screenlet-header">
<label style="boxhead" text="${uiLabelMap.ExampleMainPage}"/>
</container>
<container style="screenlet-body">
<section>
<condition><if-empty field-name="userLogin"/></condition>
<widgets>
<container><label text="${uiLabelMap.ExampleMessage}"/></container>
</widgets>
</section>
<container><label text="${uiLabelMap.ExampleWelcome}"/></container>
</container>
</container>
<screenlet title="${uiLabelMap.ExampleMainPage}">
<section>
<condition><if-empty field-name="userLogin"/></condition>
<widgets>
<container><label text="${uiLabelMap.ExampleMessage}"/></container>
</widgets>
</section>
<label text="${uiLabelMap.ExampleWelcome}"/>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>
@@ -26,7 +26,6 @@ under the License.
<actions>
<set field="headerItem" value="AjaxExample"/>
<set field="titleProperty" value="PageTitleFindExample"/>
<set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/prototype.js" global="true"/>
</actions>
<widgets>
@@ -37,10 +36,11 @@ under the License.
<if-has-permission permission="EXAMPLE" action="_VIEW"/>
</condition>
<widgets>
<container><label style="h1">${uiLabelMap.${titleProperty}}</label></container>
<container style="h1"><label>${uiLabelMap.${titleProperty}}</label></container>
<container id="ListExamplesAutoUpdate" auto-update-target="ListExampleFormOnly">
<include-screen name="ListExampleFormOnly"/>
</container>
<container style="h2"><label>${uiLabelMap.ExampleNewExample}</label></container>
<include-screen name="CreateExampleFormOnly"/>
</widgets>
<fail-widgets>
@@ -65,6 +65,7 @@ under the License.
</widgets>
</section>
</screen>
<screen name="CreateExampleFormOnly">
<section>
<actions>
@@ -77,4 +78,5 @@ under the License.
</widgets>
</section>
</screen>
</screens>
@@ -20,6 +20,7 @@ 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="ListExampleFeatures" type="list" list-name="examples"
paginate-target="FindExampleFeature">
<actions>
@@ -27,12 +28,12 @@ under the License.
<order-by field-name="description"/>
</entity-condition>
</actions>
<field name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}" widget-style="buttontext">
<hyperlink also-hidden="false" description="${exampleFeatureId}" target="EditExampleFeature?exampleFeatureId=${exampleFeatureId}"/>
</field>
<field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
</form>
<form name="EditExampleFeature" type="single" target="updateExampleFeature" title="" default-map-name="exampleFeature">
<actions>
<entity-one entity-name="StatusItem" value-name="currentStatus" auto-field-map="false">
@@ -41,11 +42,9 @@ under the License.
</actions>
<alt-target use-when="exampleFeature==null" target="createExampleFeature"/>
<auto-fields-service service-name="updateExampleFeature"/>
<field use-when="exampleFeature!=null" name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}" tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
<field use-when="exampleFeature==null&amp;&amp;exampleFeatureId==null" name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}"><ignored/></field>
<field use-when="exampleFeature==null&amp;&amp;exampleFeatureId!=null" name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}"><display description="${uiLabelMap.CommonCannotBeFound}: [${exampleFeatureId}]" also-hidden="false"/></field>
<field name="description" title="${uiLabelMap.CommonDescription}"/>
<field name="featureSourceEnumId" title="${uiLabelMap.ExampleFeatureSource}">
<drop-down allow-empty="false">
@@ -68,7 +67,6 @@ under the License.
</entity-condition>
</actions>
<auto-fields-service service-name="updateExampleFeatureAppl"/>
<field name="exampleId" title="${uiLabelMap.ExampleExample}">
<display-entity entity-name="Example" description="${exampleName}">
<sub-hyperlink target="EditExample?exampleId=${exampleId}" description="${exampleId}" link-style="buttontext"/>
@@ -83,16 +81,15 @@ under the License.
</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="feature_deleteExampleFeatureAppl?exampleId=${exampleId}&amp;exampleFeatureId=${exampleFeatureId}&amp;fromDate=${fromDate}"
description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
</field>
</form>
<form name="AddExampleFeatureAppl" type="single" target="feature_createExampleFeatureAppl" title="">
<auto-fields-service service-name="createExampleFeatureAppl"/>
<field name="exampleId" title="${uiLabelMap.ExampleExample}">
<drop-down allow-empty="false">
<entity-options entity-name="Example" description="${exampleName} [${exampleId}]">
@@ -126,6 +123,7 @@ under the License.
<field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
<field name="submitButton" title="${uiLabelMap.CommonLookup}"><submit button-type="button"/></field>
</form>
<form name="LookupListExampleFeature" list-name="listIt" title="" type="list"
paginate-target="LookupExampleFeature">
<actions>
@@ -144,4 +142,5 @@ under the License.
</field>
<field name="description" title="${uiLabelMap.CommonDescription}"><display also-hidden="false"/></field>
</form>
</forms>
@@ -20,6 +20,7 @@ under the License.
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="FindExampleFeature">
<section>
<actions>
@@ -55,7 +56,6 @@ under the License.
<actions>
<set field="titleProperty" value="PageTitleEditExampleFeature"/>
<set field="tabButtonItem" value="EditExampleFeature"/>
<set field="exampleFeatureId" from-field="parameters.exampleFeatureId"/>
<entity-one entity-name="ExampleFeature" value-name="exampleFeature"/>
</actions>
@@ -68,6 +68,7 @@ under the License.
</widgets>
</section>
</screen>
<screen name="EditExampleFeatureExampleAppls">
<section>
<actions>
@@ -109,4 +110,5 @@ under the License.
</widgets>
</section>
</screen>
</screens>
@@ -20,11 +20,11 @@ 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>
@@ -33,7 +33,7 @@ under the License.
<field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
<field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
</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">
@@ -42,11 +42,9 @@ under the License.
</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}">
@@ -70,9 +68,7 @@ under the License.
</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}"/>
@@ -84,10 +80,10 @@ under the License.
<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>
<form name="EditExampleBackgroundSubmit" extends="EditExample">
<field name="submitButton" use-when="example==null" title="${uiLabelMap.CommonCreate}"><submit button-type="button" background-submit-refresh-target="CreateExampleFormOnly"/></field>
<field name="submitButton" use-when="example!=null" title="${uiLabelMap.CommonUpdate}"><submit button-type="button" background-submit-refresh-target="CreateExampleFormOnly"/></field>
@@ -102,7 +98,6 @@ under the License.
</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>
@@ -114,16 +109,15 @@ under the License.
</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}">
@@ -146,7 +140,6 @@ under the License.
</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}">
@@ -161,16 +154,15 @@ under the License.
</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" title="${uiLabelMap.ExampleFeature}"><lookup target-form-name="LookupExampleFeature"/></field>
<field name="exampleFeatureApplTypeId" title="${uiLabelMap.CommonType}">
@@ -182,4 +174,5 @@ under the License.
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
</form>
</forms>
@@ -50,6 +50,7 @@ under the License.
<link target="EditExampleFeatureAppls?exampleId=${exampleId}"/>
</menu-item>
</menu>
<menu name="EditExampleFeature" default-selected-style="selected" type="simple"
menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="EditExampleFeature" title="${uiLabelMap.ExampleFeature}">
@@ -59,4 +60,5 @@ under the License.
<link target="EditExampleFeatureExampleAppls?exampleFeatureId=${exampleFeatureId}"/>
</menu-item>
</menu>
</menus>
@@ -20,6 +20,7 @@ under the License.
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="FindExample">
<section>
<actions>
@@ -34,7 +35,7 @@ under the License.
<if-has-permission permission="EXAMPLE" action="_VIEW"/>
</condition>
<widgets>
<container><label style="h1">${uiLabelMap.${titleProperty}}</label></container>
<container style="h1"><label>${uiLabelMap.${titleProperty}}</label></container>
<container style="button-bar"><link target="EditExample" text="${uiLabelMap.ExampleNewExample}" style="buttontext"/></container>
<include-form name="ListExamples" location="component://example/widget/example/ExampleForms.xml"/>
</widgets>
@@ -53,7 +54,6 @@ under the License.
<actions>
<set field="titleProperty" value="PageTitleEditExample"/>
<set field="tabButtonItem" value="EditExample"/>
<set field="exampleId" from-field="parameters.exampleId"/>
<entity-one entity-name="Example" value-name="example"/>
</actions>
@@ -66,12 +66,12 @@ under the License.
</widgets>
</section>
</screen>
<screen name="EditExampleItems">
<section>
<actions>
<set field="titleProperty" value="PageTitleEditExampleItems"/>
<set field="tabButtonItem" value="EditExampleItems"/>
<set field="exampleId" from-field="parameters.exampleId"/>
</actions>
<widgets>
@@ -84,12 +84,12 @@ under the License.
</widgets>
</section>
</screen>
<screen name="EditExampleFeatureAppls">
<section>
<actions>
<set field="titleProperty" value="PageTitleEditExampleFeatureAppls"/>
<set field="tabButtonItem" value="EditExampleFeatureAppls"/>
<set field="exampleId" from-field="parameters.exampleId"/>
</actions>
<widgets>
@@ -102,4 +102,5 @@ under the License.
</widgets>
</section>
</screen>
</screens>
@@ -20,6 +20,7 @@ under the License.
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="FormWidgetExamples">
<section>
<actions>
@@ -63,4 +64,5 @@ under the License.
</widgets>
</section>
</screen>
</screens>