[OFBiz] SVN: r6080 - in trunk/framework/widget: dtd src/org/ofbiz/widget/screen

jonesde at svn.ofbiz.org jonesde at svn.ofbiz.org
Sat Nov 5 22:58:24 EST 2005


Author: jonesde
Date: 2005-11-05 21:57:57 -0600 (Sat, 05 Nov 2005)
New Revision: 6080

Modified:
   trunk/framework/widget/dtd/widget-form.xsd
   trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
Log:
Added missing condition-object defs for form widget; fixed issue with get-related when the source doesn't exist

Modified: trunk/framework/widget/dtd/widget-form.xsd
===================================================================
--- trunk/framework/widget/dtd/widget-form.xsd	2005-11-05 15:26:59 UTC (rev 6079)
+++ trunk/framework/widget/dtd/widget-form.xsd	2005-11-06 03:57:57 UTC (rev 6080)
@@ -1012,6 +1012,7 @@
                 <xs:choice minOccurs="0">
                     <xs:element ref="condition-expr"/>
                     <xs:element ref="condition-list"/>
+                    <xs:element ref="condition-object"/>
                 </xs:choice>
                 <xs:element minOccurs="0" ref="having-condition-list"/>
                 <xs:element minOccurs="0" maxOccurs="unbounded" ref="select-field"/>
@@ -1139,6 +1140,7 @@
             <xs:choice maxOccurs="unbounded">
                 <xs:element ref="condition-expr"/>
                 <xs:element ref="condition-list"/>
+                <xs:element ref="condition-object"/>
             </xs:choice>
             <xs:attributeGroup ref="attlist.condition-list"/>
         </xs:complexType>
@@ -1168,6 +1170,7 @@
             <xs:choice maxOccurs="unbounded">
                 <xs:element ref="condition-expr"/>
                 <xs:element ref="condition-list"/>
+                <xs:element ref="condition-object"/>
             </xs:choice>
             <xs:attributeGroup ref="attlist.having-condition-list"/>
         </xs:complexType>

Modified: trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java
===================================================================
--- trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java	2005-11-05 15:26:59 UTC (rev 6079)
+++ trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java	2005-11-06 03:57:57 UTC (rev 6080)
@@ -541,16 +541,16 @@
 
         public void runAction(Map context) {
             Object valueObject = valueNameAcsr.get(context);
+            if (valueObject == null) {
+                Debug.logVerbose("Value not found with name: " + valueNameAcsr + ", not getting related...", module);
+                return;
+            }
             if (!(valueObject instanceof GenericValue)) {
                 String errMsg = "Env variable for value-name " + valueNameAcsr.toString() + " is not a GenericValue object; for the relation-name: " + relationName + "]";
                 Debug.logError(errMsg, module);
                 throw new IllegalArgumentException(errMsg);
             }
             GenericValue value = (GenericValue) valueObject;
-            if (value == null) {
-                Debug.logWarning("Value not found with name: " + valueNameAcsr + ", not getting related...", module);
-                return;
-            }
             try {
                 if (useCache) {
                     toValueNameAcsr.put(context, value.getRelatedOneCache(relationName));



More information about the Svn mailing list