[WidgetInForm] Refresh all WidgetInForm-fields in processFICreturn
authorStefan Hühner <stefan.huehner@openbravo.com>
Mon, 01 Aug 2011 17:39:50 +0200
changeset 13371 ffa95c0d6236
parent 13370 06348d284aeb
child 13372 2c4ba052c7cd
[WidgetInForm] Refresh all WidgetInForm-fields in processFICreturn
This refreshes the widgets when data is received from the backend i.e. on new,
navigation, after a callout and also allows passing this new data to the widget
so it can be used in the widget parameters.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Aug 01 17:38:24 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Aug 01 17:39:50 2011 +0200
@@ -681,6 +681,14 @@
       delete this.getFields()[i]._changedByFic;
     }
 
+    // refresh WidgetInForm fields if present (as they might depend on data of current record) 
+    for (i = 0; i < this.getFields().length; i++) {
+      var locField  = this.getFields()[i];
+      if (locField.hasOwnProperty("widgetClassId")) {
+        locField.refresh(this);
+      }
+    }
+
     this.markForRedraw();
 
     delete this.inFicCall;