svn commit: r647683 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh

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

svn commit: r647683 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh

jleroux@apache.org
Author: jleroux
Date: Mon Apr 14 00:49:09 2008
New Revision: 647683

URL: http://svn.apache.org/viewvc?rev=647683&view=rev
Log:
Better handling of multi-errors (from David's suggestion in dev ML)

Modified:
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh?rev=647683&r1=647682&r2=647683&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh Mon Apr 14 00:49:09 2008
@@ -67,6 +67,7 @@
 String curFindString = "entityName=" + entityName + "&find=" + find;
 
 GenericEntity findByEntity = delegator.makeValue(entityName);
+List errMsgList = FastList.newInstance();
 for (int fnum = 0; fnum < modelEntity.getFieldsSize(); fnum++) {
     ModelField field = modelEntity.getField(fnum);
     String fval = parameters.get(field.getName());
@@ -76,12 +77,16 @@
             try {
                 findByEntity.setString(field.getName(), fval);
             } catch (NumberFormatException nfe) {
-                Debug.logError(nfe, "Caught an exception : "+nfe.toString(), "FindGeneric.bsh");
-                request.setAttribute("_ERROR_MESSAGE_", "Entered value is non-numeric for numeric field: "+field.getName());
+                Debug.logError(nfe, "Caught an exception : " + nfe.toString(), "FindGeneric.bsh");
+                errMsgList.add("Entered value is non-numeric for numeric field: " + field.getName());
             }
         }
     }
 }
+if (errMsgList.size() > 0) {
+    request.setAttribute("_ERROR_MESSAGE_LIST_", errMsgList);
+}
+
 curFindString = UtilFormatOut.encodeQuery(curFindString);
 context.put("curFindString", curFindString);