svn commit: r670340 - in /ofbiz/trunk/framework/example/widget/example: ExampleFeatureForms.xml ExampleFeatureScreens.xml ExampleForms.xml ExampleScreens.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r670340 - in /ofbiz/trunk/framework/example/widget/example: ExampleFeatureForms.xml ExampleFeatureScreens.xml ExampleForms.xml ExampleScreens.xml

jleroux@apache.org
Author: jleroux
Date: Sun Jun 22 04:08:33 2008
New Revision: 670340

URL: http://svn.apache.org/viewvc?rev=670340&view=rev
Log:
A patch from Bruno Busco "Example application should use FindScreenDecorator" (https://issues.apache.org/jira/browse/OFBIZ-1846) - OFBIZ-1846

Modified:
    ofbiz/trunk/framework/example/widget/example/ExampleFeatureForms.xml
    ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml
    ofbiz/trunk/framework/example/widget/example/ExampleForms.xml
    ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml

Modified: ofbiz/trunk/framework/example/widget/example/ExampleFeatureForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleFeatureForms.xml?rev=670340&r1=670339&r2=670340&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleFeatureForms.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleFeatureForms.xml Sun Jun 22 04:08:33 2008
@@ -21,12 +21,20 @@
 <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">
+    <form name="FindExampleFeatures" type="single" target="FindExampleFeature" default-entity-name="ExampleFeature" default-field-type="find">
+        <field name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}"><text-find/></field>
+        <field name="description" title="${uiLabelMap.CommonDescription}"><text-find/></field>
+        <field name="searchButton" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+
+
+    <form name="ListExampleFeatures" type="list" 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>
-            <entity-condition entity-name="ExampleFeature">
-                <order-by field-name="description"/>
-            </entity-condition>
+            <service service-name="performFind" result-map-name="result" result-map-list-name="listIt">
+                <field-map field-name="inputFields" env-name="exampleFeatureCtx"/>
+                <field-map field-name="entityName" value="ExampleFeature"/>
+            </service>
         </actions>
         <field name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${exampleFeatureId}" target="EditExampleFeature?exampleFeatureId=${exampleFeatureId}"/>

Modified: ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml?rev=670340&r1=670339&r2=670340&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleFeatureScreens.xml Sun Jun 22 04:08:33 2008
@@ -21,11 +21,14 @@
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
 
+    <!-- list all examplefeatures in a tabular format -->
     <screen name="FindExampleFeature">
         <section>
             <actions>
                 <set field="headerItem" value="ExampleFeature"/>
                 <set field="titleProperty" value="PageTitleFindExampleFeature"/>
+                <set field="exampleFeatureCtx" from-field="parameters"/>
+                <set field="noConditionFind" value="Y"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -35,11 +38,17 @@
                                 <if-has-permission permission="EXAMPLE" action="_VIEW"/>
                             </condition>
                             <widgets>
-                                <container style="h1"><label>${uiLabelMap.${titleProperty}}</label></container>
-                                <container style="button-bar">
-                                    <link target="EditExampleFeature" text="${uiLabelMap.ExampleNewExampleFeature}" style="buttontext"/>
-                                </container>
-                                <include-form name="ListExampleFeatures" location="component://example/widget/example/ExampleFeatureForms.xml"/>
+                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                                    <decorator-section name="menu-bar">
+                                        <container style="button-bar"><link target="EditExampleFeature" text="${uiLabelMap.ExampleNewExampleFeature}" style="buttontext"/></container>
+                                    </decorator-section>
+                                    <decorator-section name="search-options">
+                                        <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"/>
+                                    </decorator-section>
+                                </decorator-screen>
                             </widgets>
                             <fail-widgets>
                                 <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>

Modified: ofbiz/trunk/framework/example/widget/example/ExampleForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleForms.xml?rev=670340&r1=670339&r2=670340&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleForms.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleForms.xml Sun Jun 22 04:08:33 2008
@@ -21,9 +21,34 @@
 <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">
+    <form name="FindExamples" type="single" target="FindExample" default-entity-name="Example" default-field-type="find">
+        <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="StatusItem">
+                    <entity-constraint name="statusTypeId" operator="equals" value="EXAMPLE_STATUS"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="searchButton" 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>
-            <entity-condition entity-name="Example"><order-by field-name="exampleName"/></entity-condition>
+            <service service-name="performFind" result-map-name="result" result-map-list-name="listIt">
+                <field-map field-name="inputFields" env-name="exampleCtx"/>
+                <field-map field-name="entityName" value="Example"/>
+            </service>
         </actions>
         <field name="exampleId" title="${uiLabelMap.ExampleExampleId}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${exampleId}" target="EditExample?exampleId=${exampleId}"/>

Modified: ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml?rev=670340&r1=670339&r2=670340&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml Sun Jun 22 04:08:33 2008
@@ -21,11 +21,14 @@
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
 
+    <!-- list all examples in a tabular format -->
     <screen name="FindExample">
         <section>
             <actions>
                 <set field="headerItem" value="Example"/>
                 <set field="titleProperty" value="PageTitleFindExample"/>
+                <set field="exampleCtx" from-field="parameters"/>
+                <set field="noConditionFind" value="Y"/>
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -35,9 +38,17 @@
                                 <if-has-permission permission="EXAMPLE" action="_VIEW"/>
                             </condition>
                             <widgets>
-                                <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"/>
+                                <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
+                                    <decorator-section name="menu-bar">
+                                        <container style="button-bar"><link target="EditExample" text="${uiLabelMap.ExampleNewExample}" style="buttontext"/></container>
+                                    </decorator-section>
+                                    <decorator-section name="search-options">
+                                        <include-form name="FindExamples" location="component://example/widget/example/ExampleForms.xml"/>
+                                    </decorator-section>
+                                    <decorator-section name="search-results">
+                                        <include-form name="ListExamples" location="component://example/widget/example/ExampleForms.xml"/>
+                                    </decorator-section>
+                                </decorator-screen>
                             </widgets>
                             <fail-widgets>
                                 <label style="h3">${uiLabelMap.ExampleViewPermissionError}</label>