svn commit: r667965 - in /ofbiz/trunk/framework: common/webcommon/includes/lookup.ftl common/webcommon/includes/lookupFooter.ftl common/widget/CommonScreens.xml widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java

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

svn commit: r667965 - in /ofbiz/trunk/framework: common/webcommon/includes/lookup.ftl common/webcommon/includes/lookupFooter.ftl common/widget/CommonScreens.xml widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java

adrianc
Author: adrianc
Date: Sun Jun 15 08:20:10 2008
New Revision: 667965

URL: http://svn.apache.org/viewvc?rev=667965&view=rev
Log:
Improved Lookup decorator, submitted by Bruno Busco - https://issues.apache.org/jira/browse/OFBIZ-1841, with modifications by me.

Added:
    ofbiz/trunk/framework/common/webcommon/includes/lookupFooter.ftl   (with props)
Modified:
    ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
    ofbiz/trunk/framework/common/widget/CommonScreens.xml
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java

Modified: ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl?rev=667965&r1=667964&r2=667965&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/lookup.ftl Sun Jun 15 08:20:10 2008
@@ -23,6 +23,7 @@
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
     <title>${title}</title>
     <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/prototype.js</@ofbizContentUrl>" type="text/javascript"></script>
+    <script language="javascript" src="<@ofbizContentUrl>/images/prototypejs/scriptaculous.js</@ofbizContentUrl>" type="text/javascript"></script>
     <script language="javascript" src="<@ofbizContentUrl>/images/fieldlookup.js</@ofbizContentUrl>" type="text/javascript"></script>
     <script language="javascript" src="<@ofbizContentUrl>/images/selectall.js</@ofbizContentUrl>" type="text/javascript"></script>
     <script language="javascript" src="<@ofbizContentUrl>/images/calendar_date_select.js</@ofbizContentUrl>" type="text/javascript"></script>
@@ -75,6 +76,3 @@
     </script>
 </head>
 <body style="background-color: WHITE;">
-${sections.render("body")}
-</body>
-</html>

Added: ofbiz/trunk/framework/common/webcommon/includes/lookupFooter.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/lookupFooter.ftl?rev=667965&view=auto
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/lookupFooter.ftl (added)
+++ ofbiz/trunk/framework/common/webcommon/includes/lookupFooter.ftl Sun Jun 15 08:20:10 2008
@@ -0,0 +1,20 @@
+<#--
+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.
+-->
+</body>
+</html>

Propchange: ofbiz/trunk/framework/common/webcommon/includes/lookupFooter.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=667965&r1=667964&r2=667965&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Sun Jun 15 08:20:10 2008
@@ -188,16 +188,25 @@
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
             </actions>
             <widgets>
-                <platform-specific>
-                    <html>
-                        <html-template-decorator location="component://common/webcommon/includes/lookup.ftl">
-                            <html-template-decorator-section name="body">
-                                <platform-specific><html><html-template location="component://common/webcommon/includes/messages.ftl"/></html></platform-specific>
-                                <decorator-section-include name="body"/>
-                            </html-template-decorator-section>
-                        </html-template-decorator>
-                    </html>
-                </platform-specific>
+                <platform-specific><html><html-template location="component://common/webcommon/includes/lookup.ftl"/></html></platform-specific>
+                <platform-specific><html><html-template location="component://common/webcommon/includes/messages.ftl"/></html></platform-specific>
+                <section>
+                    <condition>
+                        <not><if-empty field-name="sections.body"/></not>
+                    </condition>
+                    <widgets>
+                        <decorator-section-include name="body"/>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${title}" name="findScreenlet" collapsible="true" padded="false">
+                            <decorator-section-include name="search-options"/>
+                        </screenlet>
+                        <screenlet>
+                            <decorator-section-include name="search-results"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+                <platform-specific><html><html-template location="component://common/webcommon/includes/lookupFooter.ftl"/></html></platform-specific>
             </widgets>
         </section>
     </screen>

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=667965&r1=667964&r2=667965&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Sun Jun 15 08:20:10 2008
@@ -146,14 +146,14 @@
         return modelScreen.boundaryCommentsEnabled();
     }
     
-    public static class SectionsRenderer {
-        protected Map sectionMap;
+    @SuppressWarnings("serial")
+    public static class SectionsRenderer extends HashMap<String, Object> {
         protected ScreenStringRenderer screenStringRenderer;
         protected Map<String, Object> context;
         protected Appendable writer;
         
-        public SectionsRenderer(Map sectionMap, Map<String, Object> context, Appendable writer, ScreenStringRenderer screenStringRenderer) {
-            this.sectionMap = sectionMap;
+        public SectionsRenderer(Map<String, ? extends Object> sectionMap, Map<String, Object> context, Appendable writer, ScreenStringRenderer screenStringRenderer) {
+            this.putAll(sectionMap);
             this.context = context;
             this.writer = writer;
             this.screenStringRenderer = screenStringRenderer;
@@ -161,7 +161,7 @@
 
         /** This is a lot like the ScreenRenderer class and returns an empty String so it can be used more easily with FreeMarker */
         public String render(String sectionName) throws GeneralException, IOException {
-            ModelScreenWidget section = (ModelScreenWidget) this.sectionMap.get(sectionName);
+            ModelScreenWidget section = (ModelScreenWidget) this.get(sectionName);
             // if no section by that name, write nothing
             if (section != null) {
                 section.renderWidgetString(this.writer, this.context, this.screenStringRenderer);