You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2016/12/18 16:55:28 UTC
svn commit: r1774906 - in
/ofbiz/trunk/specialpurpose/example/widget/example: ExampleAjaxScreens.xml
ExampleFeatureForms.xml ExampleFeatureScreens.xml ExampleForms.xml
ExampleScreens.xml
Author: jleroux
Date: Sun Dec 18 16:55:27 2016
New Revision: 1774906
URL: http://svn.apache.org/viewvc?rev=1774906&view=rev
Log:
Improved: Refactor forms in Example
(OFBIZ-9146)
Refactoring form definitions with type='single'
Refactoring various lists forms into grids.
Refactoring various list form references in screen widgets into grid references
Thanks: Pierre Smits
Modified:
ofbiz/trunk/specialpurpose/example/widget/example/ExampleAjaxScreens.xml
ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureForms.xml
ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureScreens.xml
ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml
ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml
Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleAjaxScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleAjaxScreens.xml?rev=1774906&r1=1774905&r2=1774906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/widget/example/ExampleAjaxScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleAjaxScreens.xml Sun Dec 18 16:55:27 2016
@@ -75,7 +75,7 @@ under the License.
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
</actions>
<widgets>
- <include-form name="ListExamplesAjax" location="component://example/widget/example/ExampleForms.xml"/>
+ <include-grid name="ListExamplesAjax" location="component://example/widget/example/ExampleForms.xml"/>
</widgets>
</section>
</screen>
Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureForms.xml?rev=1774906&r1=1774905&r2=1774906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureForms.xml (original)
+++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureForms.xml Sun Dec 18 16:55:27 2016
@@ -29,7 +29,7 @@ under the License.
</form>
- <form name="ListExampleFeatures" type="list" list-name="listIt" paginate-target="FindExampleFeature" default-entity-name="ExampleFeature"
+ <grid name="ListExampleFeatures" list-name="listIt" paginate-target="FindExampleFeature" default-entity-name="ExampleFeature"
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">
@@ -45,7 +45,7 @@ under the License.
</hyperlink>
</field>
<field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
- </form>
+ </grid>
<form name="EditExampleFeature" type="single" target="updateExampleFeature" title="" default-map-name="exampleFeature">
<actions>
@@ -72,7 +72,7 @@ under the License.
</form>
<!-- ExampleFeatureAppl -->
- <form name="ListExampleFeatureAppls" type="list" list-name="exampleFeatureAppls" target="feature_updateExampleFeatureAppl">
+ <grid name="ListExampleFeatureAppls" list-name="exampleFeatureAppls" target="feature_updateExampleFeatureAppl">
<actions>
<entity-condition entity-name="ExampleFeatureAppl">
<order-by field-name="exampleId"/>
@@ -104,7 +104,7 @@ under the License.
<parameter param-name="fromDate"/>
</hyperlink>
</field>
- </form>
+ </grid>
<form name="AddExampleFeatureAppl" type="single" target="feature_createExampleFeatureAppl" title="">
@@ -149,7 +149,7 @@ under the License.
<field name="submitButton" title="${uiLabelMap.CommonFind}"><submit button-type="button"/></field>
</form>
- <form name="LookupListExampleFeature" list-name="listIt" title="" type="list"
+ <grid name="LookupListExampleFeature" list-name="listIt" title=""
paginate-target="LookupExampleFeature">
<actions>
<service service-name="performFind" result-map="result" result-map-list="listIt">
@@ -168,6 +168,6 @@ under the License.
<display-entity entity-name="Enumeration" key-field-name="enumId" description="${description} [${enumCode}]" also-hidden="false"/>
</field>
<field name="description" title="${uiLabelMap.CommonDescription}"><display also-hidden="false"/></field>
- </form>
+ </grid>
</forms>
Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureScreens.xml?rev=1774906&r1=1774905&r2=1774906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleFeatureScreens.xml Sun Dec 18 16:55:27 2016
@@ -45,7 +45,7 @@ under the License.
<include-form name="FindExampleFeatures" location="component://example/widget/example/ExampleFeatureForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
- <include-form name="ListExampleFeatures" location="component://example/widget/example/ExampleFeatureForms.xml"/>
+ <include-grid name="ListExampleFeatures" location="component://example/widget/example/ExampleFeatureForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
@@ -90,7 +90,7 @@ under the License.
<decorator-screen name="CommonExampleFeatureDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<screenlet title="${uiLabelMap.ExampleFeaturesByExample}">
- <include-form name="ListExampleFeatureAppls" location="component://example/widget/example/ExampleFeatureForms.xml"/>
+ <include-grid name="ListExampleFeatureAppls" location="component://example/widget/example/ExampleFeatureForms.xml"/>
</screenlet>
<screenlet title="Add Feature To Example">
<include-form name="AddExampleFeatureAppl" location="component://example/widget/example/ExampleFeatureForms.xml"/>
@@ -136,7 +136,7 @@ under the License.
<include-form name="LookupFindExampleFeature" location="component://example/widget/example/ExampleFeatureForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
- <include-form name="LookupListExampleFeature" location="component://example/widget/example/ExampleFeatureForms.xml"/>
+ <include-grid name="LookupListExampleFeature" location="component://example/widget/example/ExampleFeatureForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml?rev=1774906&r1=1774905&r2=1774906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml (original)
+++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleForms.xml Sun Dec 18 16:55:27 2016
@@ -51,7 +51,7 @@ under the License.
</field>
</form>
- <form name="ListExamples" type="list" list-name="listIt" paginate-target="FindExample" default-entity-name="Example" separate-columns="true"
+ <grid name="ListExamples" 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">
@@ -75,15 +75,15 @@ under the License.
<field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
<field name="description" title="${uiLabelMap.CommonDescription}" sort-field="true"><display/></field>
<field name="conditionalDesc" ignore-when=""exampleName".equals(sortField)" title="my desc"><display description="${description}"/></field>
- </form>
+ </grid>
<!--example form with include an other form -->
- <form name="ListExamplesWithFeatures" type="list" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml">
+ <grid name="ListExamplesWithFeatures" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml">
<actions>
<call-parent-actions/>
</actions>
<field name="features"><include-form name="ExampleFeaturesInLine" location="component://example/widget/example/ExampleForms.xml"/></field>
- </form>
+ </grid>
<form name="ExampleFeaturesInLine" type="list" default-table-style="basic-table light-grid" default-entity-name="ExampleFeatureAppl">
<actions>
<entity-condition entity-name="ExampleFeatureAppl">
@@ -96,13 +96,14 @@ under the License.
</form>
<!--example form with include a screen -->
- <form name="ListExamplesWithItems" type="list" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml">
+ <grid name="ListExamplesWithItems" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml">
<actions>
<call-parent-actions/>
</actions>
<field name="items"><include-screen name="ExampleItemsInLine" location="component://example/widget/example/ExampleScreens.xml"/></field>
- </form>
- <form name="ListExampleItemsInLine" type="list" default-table-style="basic-table light-grid">
+ </grid>
+
+ <grid name="ListExampleItemsInLine" default-table-style="basic-table light-grid">
<actions>
<entity-condition entity-name="ExampleItem">
<condition-expr field-name="exampleId" from-field="exampleId"/>
@@ -110,15 +111,16 @@ under the License.
</actions>
<auto-fields-entity entity-name="ExampleItem" default-field-type="display"/>
<field name="exampleId"><ignored/></field>
- </form>
+ </grid>
<!--example form with include a grid -->
- <form name="ListExamplesWithStatus" type="list" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml">
+ <grid name="ListExamplesWithStatus" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml">
<actions>
<call-parent-actions/>
</actions>
<field name="status"><include-grid name="ExampleStatusInLine" location="component://example/widget/example/ExampleForms.xml"/></field>
- </form>
+ </grid>
+
<grid name="ExampleStatusInLine" default-table-style="basic-table light-grid" default-entity-name="ExampleStatus">
<actions>
<entity-condition entity-name="ExampleStatus">
@@ -130,16 +132,17 @@ under the License.
<field name="exampleId"><ignored/></field>
</grid>
- <form name="ListExampleExport" type="list" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml" paginate="false">
+ <grid name="ListExampleExport" extends="ListExamples" extends-resource="component://example/widget/example/ExampleForms.xml" paginate="false">
<actions>
<call-parent-actions/>
</actions>
- </form>
+ </grid>
+
<!-- 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">
+ <grid name="ListExamplesAjax" extends="ListExamples" paginate-target="authview/findExampleAjax">
<actions>
<entity-condition entity-name="Example"><order-by field-name="exampleName"/></entity-condition>
</actions>
@@ -167,7 +170,7 @@ under the License.
</display>
</field>
<on-event-update-area event-type="paginate" area-id="ListExamplesAjax" area-target="ListExampleFormOnly"/>
- </form>
+ </grid>
<form name="EditExample" type="single" target="updateExample" title="" default-map-name="example" default-entity-name="Example">
<actions>
@@ -233,7 +236,7 @@ under the License.
</form>
<!-- ExampleItem -->
- <form name="ListExampleItems" type="list" list-name="exampleItems" target="updateExampleItem">
+ <grid name="ListExampleItems" list-name="exampleItems" target="updateExampleItem">
<actions>
<entity-condition entity-name="ExampleItem">
<condition-expr field-name="exampleId" from-field="exampleId"/>
@@ -259,7 +262,7 @@ under the License.
</hyperlink>
</field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
- </form>
+ </grid>
<form name="AddExampleItem" type="single" target="createExampleItem" title="">
<auto-fields-service service-name="createExampleItem"/>
@@ -277,7 +280,7 @@ under the License.
</form>
<!-- ExampleFeatureAppl -->
- <form name="ListExampleFeatureAppls" type="list" list-name="exampleFeatureAppls" target="example_updateExampleFeatureAppl">
+ <grid name="ListExampleFeatureAppls" list-name="exampleFeatureAppls" target="example_updateExampleFeatureAppl">
<actions>
<entity-condition entity-name="ExampleFeatureAppl">
<condition-expr field-name="exampleId" from-field="exampleId"/>
@@ -309,7 +312,7 @@ under the License.
<parameter param-name="fromDate"/>
</hyperlink>
</field>
- </form>
+ </grid>
<form name="AddExampleFeatureAppl" type="single" target="example_createExampleFeatureAppl" title="">
<auto-fields-service service-name="createExampleFeatureAppl"/>
Modified: ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml?rev=1774906&r1=1774905&r2=1774906&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/example/widget/example/ExampleScreens.xml Sun Dec 18 16:55:27 2016
@@ -50,7 +50,7 @@ under the License.
<include-form name="FindExamples" location="component://example/widget/example/ExampleForms.xml"/>
</decorator-section>
<decorator-section name="search-results">
- <include-form name="${formExampleListName}" location="component://example/widget/example/ExampleForms.xml"/>
+ <include-grid name="${formExampleListName}" location="component://example/widget/example/ExampleForms.xml"/>
</decorator-section>
</decorator-screen>
</widgets>
@@ -77,7 +77,7 @@ under the License.
<set field="exampleCtx" from-field="parameters"/>
</actions>
<widgets>
- <include-form name="ListExampleExport" location="component://example/widget/example/ExampleForms.xml"/>
+ <include-grid name="ListExampleExport" location="component://example/widget/example/ExampleForms.xml"/>
</widgets>
<fail-widgets>
<label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>
@@ -152,7 +152,7 @@ under the License.
<widgets>
<decorator-screen name="CommonExampleDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
- <include-form name="ListExampleItems" location="component://example/widget/example/ExampleForms.xml"/>
+ <include-grid name="ListExampleItems" location="component://example/widget/example/ExampleForms.xml"/>
<include-form name="AddExampleItem" location="component://example/widget/example/ExampleForms.xml"/>
</decorator-section>
</decorator-screen>
@@ -166,7 +166,7 @@ under the License.
<link text="${uiLabelMap.CommonEdit}" target="EditExampleItems">
<parameter param-name="exampleId" from-field="exampleId"/>
</link>
- <include-form name="ListExampleItemsInLine" location="component://example/widget/example/ExampleForms.xml"/>
+ <include-grid name="ListExampleItemsInLine" location="component://example/widget/example/ExampleForms.xml"/>
</widgets>
</section>
</screen>
@@ -181,7 +181,7 @@ under the License.
<widgets>
<decorator-screen name="CommonExampleDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
- <include-form name="ListExampleFeatureAppls" location="component://example/widget/example/ExampleForms.xml"/>
+ <include-grid name="ListExampleFeatureAppls" location="component://example/widget/example/ExampleForms.xml"/>
<include-form name="AddExampleFeatureAppl" location="component://example/widget/example/ExampleForms.xml"/>
</decorator-section>
</decorator-screen>