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 2010/04/19 16:03:41 UTC

svn commit: r935578 - in /ofbiz/trunk/framework: common/widget/CommonScreens.xml example/widget/example/FormWidgetExampleLookupScreens.xml images/webapp/images/fieldlookup.js

Author: jleroux
Date: Mon Apr 19 14:03:41 2010
New Revision: 935578

URL: http://svn.apache.org/viewvc?rev=935578&view=rev
Log:
A slightly modified "only one lookup decorator" patch from Sascha Rodekamp related to "Replace popup lookups by layer lookups" (https://issues.apache.org/jira/browse/OFBIZ-3442) - OFBIZ-3442

Merge the 2 lookup decorators in only one and dynamically adapt the rendered content

Modified:
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=935578&r1=935577&r2=935578&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Mon Apr 19 14:03:41 2010
@@ -248,7 +248,14 @@ under the License.
                         <set field="defaultOrganizationPartyCurrencyUomId" from-field="orgParty.baseCurrencyUomId" default-value="${defaultCurrencyUomId}" global="true"/>
                     </actions>
                     <widgets>
-                        <platform-specific><html><html-template location="component://common/webcommon/includes/lookup.ftl"/></html></platform-specific>
+                        <section>
+                        <condition>
+                            <if-compare value="layer" operator="not-equals" field="parameters.presentation"/>
+                        </condition>
+                            <widgets>
+                                <platform-specific><html><html-template location="component://common/webcommon/includes/lookup.ftl" /></html></platform-specific>
+                            </widgets>
+                        </section>
                         <platform-specific><html><html-template location="${messagesTemplateLocation}"/></html></platform-specific>
                         <section>
                             <condition>
@@ -270,70 +277,13 @@ under the License.
                                 </screenlet>
                             </fail-widgets>
                         </section>
-                        <platform-specific><html><html-template location="component://common/webcommon/includes/lookupFooter.ftl"/></html></platform-specific>
-                    </widgets>        
-                </section>
-            </widgets>
-            <fail-widgets>
-                <section>
-                    <actions>
-                        <set field="searchType" from-field="parameters.searchType" default-value="${searchType}"/>
-                        <property-to-field resource="widget" property="widget.autocompleter.defaultViewSize" field="autocompleterViewSize"/>
-                        <script location="component://common/webcommon/WEB-INF/actions/includes/FindAutocompleteOptions.groovy"/>
-                    </actions>
-                    <widgets>
-                        <platform-specific><html><html-template location="component://common/webcommon/includes/ajaxAutocompleteOptions.ftl"/></html></platform-specific>
-                    </widgets>
-                </section>
-            </fail-widgets>
-        </section>
-    </screen>
-
-    <!-- Global decorator for Lookup layer pop-up windows -->
-    <screen name="LookupLayerPopupDecorator">
-        <section>
-            <condition>
-                <if-empty field="parameters.ajaxLookup"/>
-            </condition>
-            <widgets>
-                <section>
-                    <actions>
-                        <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
-                        <service service-name="getUserPreferenceGroup" result-map="prefResult">
-                            <field-map field-name="userPrefGroupTypeId" value="GLOBAL_PREFERENCES"/>
-                        </service>
-                        <set field="userPreferences" from-field="prefResult.userPrefMap" global="true"/>
-        
-                        <property-map resource="general" map-name="generalProperties" global="true"/>
-                        <set field="visualThemeId" from-field="userPreferences.VISUAL_THEME" global="true"/>
-                        <service service-name="getVisualThemeResources">
-                            <field-map field-name="visualThemeId"/>
-                            <field-map field-name="themeResources" from-field="layoutSettings"/>
-                        </service>
-                        <set field="layoutSettings" from-field="themeResources" default-value="${layoutSettings}" global="true"/>
-                        <set field="messagesTemplateLocation" from-field="layoutSettings.VT_MSG_TMPLT_LOC[0]" default-value="component://common/webcommon/includes/messages.ftl"/>
-                    </actions>
-                    <widgets>
-                        <platform-specific><html><html-template location="${messagesTemplateLocation}"/></html></platform-specific>
                         <section>
-                            <condition>
-                                <not><if-empty-section section-name="body"/></not>
-                            </condition>
+                        <condition>
+                            <if-compare value="layer" operator="not-equals" field="parameters.presentation"/>
+                        </condition>
                             <widgets>
-                                <decorator-section-include name="body"/>
+                                <platform-specific><html><html-template location="component://common/webcommon/includes/lookupFooter.ftl"/></html></platform-specific>
                             </widgets>
-                            <fail-widgets>
-                                <screenlet title="${title}" id="findScreenlet" collapsible="false" padded="false">
-                                    <container id="search-options">
-                                        <decorator-section-include name="search-options"/>
-                                    </container>
-                                </screenlet>
-                                <screenlet>
-                                    <container id="search-results">
-                                        <decorator-section-include name="search-results"/>
-                                    </container>
-                                </screenlet>
-                            </fail-widgets>
                         </section>
                     </widgets>
                 </section>

Modified: ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml?rev=935578&r1=935577&r2=935578&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml (original)
+++ ofbiz/trunk/framework/example/widget/example/FormWidgetExampleLookupScreens.xml Mon Apr 19 14:03:41 2010
@@ -52,7 +52,7 @@ under the License.
                 <script location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="LookupLayerPopupDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="search-options">
                         <include-form name="lookupPartyName" location="component://example/widget/example/FormWidgetExampleLookupForms.xml"/>
                     </decorator-section>
@@ -92,7 +92,7 @@ under the License.
                 <script location="component://party/webapp/partymgr/WEB-INF/actions/party/StatusCondition.groovy"/>
             </actions>
             <widgets>
-                <decorator-screen name="LookupLayerPopupDecorator" location="component://common/widget/CommonScreens.xml">
+                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
                     <decorator-section name="search-options">
                         <include-form name="lookupPartyNameByName" location="component://example/widget/example/FormWidgetExampleLookupForms.xml"/>
                     </decorator-section>

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=935578&r1=935577&r2=935578&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Mon Apr 19 14:03:41 2010
@@ -343,6 +343,7 @@ var FieldLookupPopup = Class.create({
         });
 
         new Ajax.Request(this.viewName, {
+            parameters: { presentation : "layer" },
             onSuccess: function (transport) {
                 var lookupContent = transport.responseText;
                 lookupDiv.appendChild(lookupCont);
@@ -678,6 +679,7 @@ function lookupPaginationAjaxRequest(nav
     if (type == 'link') {
         navAction = navAction.substring(0, navAction.length - 1);
     }
+    navAction = navAction + "&presentation=layer";
     new Ajax.Request(navAction, {
         method: 'get',
         requestHeaders: {
@@ -686,7 +688,7 @@ function lookupPaginationAjaxRequest(nav
         onSuccess: function (transport) {
             var formRequest = transport.responseText;
             $('fieldLookupContent').remove();
-            $('fieldLookup').insert({
+            lookupDiv.insert({
                 bottom: "<div id='fieldLookupContent'>" + formRequest + "</div>"
             });
             modifySubmitButton(lookupDiv);