svn commit: r582338 - in /ofbiz/trunk/framework/widget: dtd/widget-form.xsd src/org/ofbiz/widget/form/ModelForm.java src/org/ofbiz/widget/html/HtmlFormRenderer.java

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

svn commit: r582338 - in /ofbiz/trunk/framework/widget: dtd/widget-form.xsd src/org/ofbiz/widget/form/ModelForm.java src/org/ofbiz/widget/html/HtmlFormRenderer.java

jleroux@apache.org
Author: jleroux
Date: Fri Oct  5 09:35:33 2007
New Revision: 582338

URL: http://svn.apache.org/viewvc?rev=582338&view=rev
Log:
This solve the "Quote WorkEffort bug" issue reported by Bilgin Ibryam (https://issues.apache.org/jira/browse/OFBIZ-1180) - OFBIZ-1180.
It does not solve the issue reported in comment https://issues.apache.org/jira/browse/OFBIZ-1180#action_12524674 "Adding WorkEffort to Communications in party manager is also broken due to extending EditWorkEffort." because then we get java.lang.IllegalArgumentException: Could not find screen with name [EditCommEventWorkEffort] in class resource [component://party/widget/partymgr/CommunicationScreens.xml]. But this is another problem : no EditCommEventWorkEffort screen is declared in CommunicationScreens.xml ! I will create a new issue for that...

I wait a bit before back porting in release4.0, to be sure that my (very simple) solution is ok for everybody.

Modified:
    ofbiz/trunk/framework/widget/dtd/widget-form.xsd
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java

Modified: ofbiz/trunk/framework/widget/dtd/widget-form.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/dtd/widget-form.xsd?rev=582338&r1=582337&r2=582338&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/dtd/widget-form.xsd (original)
+++ ofbiz/trunk/framework/widget/dtd/widget-form.xsd Fri Oct  5 09:35:33 2007
@@ -190,13 +190,13 @@
         </xs:attribute>
         <xs:attribute type="xs:string" name="header-row-style">
             <xs:annotation><xs:documentation>The header-row-style specifies the style to use in the header of table.</xs:documentation></xs:annotation>
-        </xs:attribute>                
+        </xs:attribute>
         <xs:attribute type="xs:string" name="default-table-style">
             <xs:annotation><xs:documentation>The default-table-style specifies the style to use in the table.</xs:documentation></xs:annotation>
         </xs:attribute>
         <!-- not sure this is such a good idea
         <xs:attribute type="xs:string" name="hidden-values-map-name">
-            <xs:annotation><xs:documentation>A map that contains hidden field name/value pairs.
+            <xs:annotation><xs:documentation>A map that contains hidden field name/value pairs.
             The reason for this is to eliminate the need to code custom forms so that auxiliary, passthru data can be sent to the server.
             By doing it this way, more standard forms can be used.
 </xs:documentation></xs:annotation>
@@ -211,6 +211,7 @@
     <xs:attributeGroup name="attlist.alt-target">
         <xs:attribute type="xs:string" name="use-when" use="required"/>
         <xs:attribute type="xs:string" name="target"/>
+        <xs:attribute type="xs:string" name="target-type"/>
     </xs:attributeGroup>
     <xs:element name="auto-fields-service">
         <xs:complexType>
@@ -305,7 +306,7 @@
     <xs:attributeGroup name="attlist.sort-field">
         <xs:attribute type="xs:string" name="name" use="required"/>
     </xs:attributeGroup>
-    
+
   <!-- ================== FIELDS ==================== -->
     <xs:element name="AllFields" abstract="true"/>
     <xs:element name="field">
@@ -453,7 +454,7 @@
     <xs:element name="date-time" substitutionGroup="AllFields">
         <xs:annotation>
             <xs:documentation>
-                A special entry for date-time fields; may just have a default size text
+                A special entry for date-time fields; may just have a default size text
                 entry box and some sort of widget to make date entry/selection easier.
             </xs:documentation>
         </xs:annotation>
@@ -937,8 +938,8 @@
         <xs:attribute type="xs:string" name="list-entry-name">
             <xs:annotation>
                 <xs:documentation>
-                    If specified the list entry will be placed in the local
-                    context, otherwise each list entry must be a Map that will be expanded
+                    If specified the list entry will be placed in the local
+                    context, otherwise each list entry must be a Map that will be expanded
                     into the local context.
                 </xs:documentation>
             </xs:annotation>
@@ -946,7 +947,7 @@
         <xs:attribute type="xs:string" name="key-name" use="required">
             <xs:annotation>
                 <xs:documentation>
-                    The value of the key-name will be the value passed
+                    The value of the key-name will be the value passed
                     to the server; this should be the full name of the location of the
                     key value in the context, given the list-entry-name or expanded
                     list-entry Map as the options you would most likely use.

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=582338&r1=582337&r2=582338&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Fri Oct  5 09:35:33 2007
@@ -1831,7 +1831,7 @@
     /** iterate through altTargets list to see if any should be used, if not return original target
      * @return The target for this Form
      */
-    public String getTarget(Map context) {
+    public String getTarget(Map context, String targetType) {
         try {
             // use the same Interpreter (ie with the same context setup) for all evals
             Interpreter bsh = this.getBshInterpreter(context);
@@ -1849,7 +1849,7 @@
                         "Return value from target condition eval was not a Boolean: " + retVal.getClass().getName() + " [" + retVal + "] of form " + this.name);
                 }
 
-                if (condTrue) {
+                if (condTrue && !targetType.equals("inter-app")) {
                     return altTarget.target;
                 }
             }
@@ -2091,7 +2091,7 @@
     public String getPaginateTarget(Map context) {
         String targ = this.paginateTarget.expandString(context);
         if (UtilValidate.isEmpty(targ)) {
-            targ = getTarget(context);
+            targ = getTarget(context, null);
         }
         
         return targ;
@@ -2117,15 +2117,15 @@
             Object value = context.get(field);
 
             if (value == null) {
-         // try parameters.VIEW_INDEX as that is an old OFBiz convention
-         Map parameters = (Map) context.get("parameters");
-         if (parameters != null) {
-            value = parameters.get("VIEW_INDEX");
-            
-            if (value == null) {
-         value = parameters.get(field);
-            }
-         }
+            // try parameters.VIEW_INDEX as that is an old OFBiz convention
+            Map parameters = (Map) context.get("parameters");
+            if (parameters != null) {
+                value = parameters.get("VIEW_INDEX");
+                
+                if (value == null) {
+                value = parameters.get(field);
+                }
+            }
             }
 
             if (value instanceof Integer) {
@@ -2156,15 +2156,15 @@
             Object value = context.get(field);
             
             if (value == null) {
-         // try parameters.VIEW_SIZE as that is an old OFBiz convention
-         Map parameters = (Map) context.get("parameters");
-         if (parameters != null) {
-            value = parameters.get("VIEW_SIZE");
-            
-            if (value == null) {
-         value = parameters.get(field);
-            }
-         }
+            // try parameters.VIEW_SIZE as that is an old OFBiz convention
+            Map parameters = (Map) context.get("parameters");
+            if (parameters != null) {
+                value = parameters.get("VIEW_SIZE");
+                
+                if (value == null) {
+                value = parameters.get(field);
+                }
+            }
             }
             
             if (value instanceof Integer) {

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=582338&r1=582337&r2=582338&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 Fri Oct  5 09:35:33 2007
@@ -1018,8 +1018,8 @@
         buffer.append("<!-- begin form widget -->");
         this.appendWhitespace(buffer);
         buffer.append("<form method=\"post\" ");
-        String targ = modelForm.getTarget(context);
         String targetType = modelForm.getTargetType();
+        String targ = modelForm.getTarget(context, targetType);
         // The 'action' attribute is mandatory in a form definition,
         // even if it is empty.
         buffer.append(" action=\"");