ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hans...@apache.org
Subject svn commit: r745434 - in /ofbiz/trunk/framework/widget: config/widget.properties dtd/widget-form.xsd src/org/ofbiz/widget/WidgetWorker.java src/org/ofbiz/widget/form/ModelFormField.java src/org/ofbiz/widget/html/HtmlFormRenderer.java
Date Wed, 18 Feb 2009 08:53:00 GMT
Author: hansbak
Date: Wed Feb 18 08:52:59 2009
New Revision: 745434

URL: http://svn.apache.org/viewvc?rev=745434&view=rev
Log:
 add a picture to the hyperlink keyword in a form to allow moving records up/down and not
showing the sequenceNum field

Modified:
    ofbiz/trunk/framework/widget/config/widget.properties
    ofbiz/trunk/framework/widget/dtd/widget-form.xsd
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java

Modified: ofbiz/trunk/framework/widget/config/widget.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/config/widget.properties?rev=745434&r1=745433&r2=745434&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/config/widget.properties (original)
+++ ofbiz/trunk/framework/widget/config/widget.properties Wed Feb 18 08:52:59 2009
@@ -24,7 +24,7 @@
 widget.verbose=true
 
 # Default number of items to be displayed per page in a list form
-widget.form.defaultViewSize=10
+widget.form.defaultViewSize=20
 
 # Controls the initial results display in Find screens. If set to Y, the
 # search result list will be populated when the Find screen first appears.

Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=745434&r1=745433&r2=745434&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original)
+++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Wed Feb 18 08:52:59 2009
@@ -812,6 +812,7 @@
             <xs:annotation><xs:documentation>Specifies the string to display,
can use the ${} syntax to insert context values; if empty the value of the field will be printed
for a default.</xs:documentation></xs:annotation>
         </xs:attribute>
         <xs:attribute type="xs:string" name="target-window"/>
+        <xs:attribute type="xs:string" name="image-location"/>
     </xs:attributeGroup>
     <xs:element name="ignored" substitutionGroup="AllFields">
         <xs:complexType/>

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=745434&r1=745433&r2=745434&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Wed Feb 18 08:52:59
2009
@@ -79,7 +79,7 @@
     }
 
     public static void makeHyperlinkString(Appendable writer, String linkStyle, String targetType,
String target, String description, HttpServletRequest request, HttpServletResponse response,
Map<String, Object> context, String targetWindow, String event, String action) throws
IOException {
-        if (UtilValidate.isNotEmpty(description)) {
+    	if (UtilValidate.isNotEmpty(description) || UtilValidate.isNotEmpty(request.getAttribute("image")))
{
             writer.append("<a");
 
             if (UtilValidate.isNotEmpty(linkStyle)) {
@@ -109,6 +109,10 @@
             }
 
             writer.append('>');
+            
+            if(request.getAttribute("image") != null){
+            	writer.append("<img src = \""+request.getAttribute("image").toString()+"\"/>");
+            }
 
             writer.append(description);
             writer.append("</a>");

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=745434&r1=745433&r2=745434&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Wed Feb 18
08:52:59 2009
@@ -2222,6 +2222,7 @@
 
         protected boolean alsoHidden = true;
         protected String targetType;
+        protected String image;
         protected FlexibleStringExpander target;
         protected FlexibleStringExpander description;
         protected FlexibleStringExpander targetWindowExdr;
@@ -2246,6 +2247,7 @@
             this.alsoHidden = !"false".equals(element.getAttribute("also-hidden"));
             this.targetType = element.getAttribute("target-type");
             this.targetWindowExdr = FlexibleStringExpander.getInstance(element.getAttribute("target-window"));
+            this.image = element.getAttribute("image-location");
         }
 
         public void renderFieldString(Appendable writer, Map<String, Object> context,
FormStringRenderer formStringRenderer) throws IOException {
@@ -2276,6 +2278,10 @@
         public String getTarget(Map<String, Object> context) {
             return this.target.expandString(context);
         }
+        
+        public String getImage(){
+        	return this.image;
+        }
 
         /**
          * @param b

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java?rev=745434&r1=745433&r2=745434&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Wed Feb 18
08:52:59 2009
@@ -333,6 +333,7 @@
      * @see org.ofbiz.widget.form.FormStringRenderer#renderHyperlinkField(java.io.Writer,
java.util.Map, org.ofbiz.widget.form.ModelFormField.HyperlinkField)
      */
     public void renderHyperlinkField(Appendable writer, Map<String, Object> context,
HyperlinkField hyperlinkField) throws IOException {
+    	this.request.setAttribute("image", hyperlinkField.getImage());
         ModelFormField modelFormField = hyperlinkField.getModelFormField();
         this.makeHyperlinkString(
             writer,



Mime
View raw message