details: /erp/devel/pi/rev/e88f79cba1a7
changeset: 10525:e88f79cba1a7
user: Iván Perdomo <ivan.perdomo <at> openbravo.com>
date: Thu Feb 10 12:10:58 2011 +0100
summary: Fixes display logic handling - The form is now shown after FIC return
diffstat:
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-field.js.ftl
| 15 ++++++-
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl
| 16 ++++----
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
| 4 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
| 20 +++++++---
4 files changed, 36 insertions(+), 19 deletions(-)
diffs (122 lines):
diff -r 78844a19c9a9 -r e88f79cba1a7
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-field.js.ftl
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-field.js.ftl
Thu Feb 10 12:07:02 2011 +0100
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-field.js.ftl
Thu Feb 10 12:10:58 2011 +0100
@@ -44,9 +44,18 @@
},
</#if>
<#if fieldDefinition.showIf != "">
- showIf: function(item, value, form, currentValues) {
- currentValues = currentValues || form.view.getCurrentValues();
- var context = form.view.getContextInfo(false, true);
+ showIf: function(item, value, form, values) {
+ var context = form.view.getContextInfo(false, true),
+ currentValues = values || form.view.getCurrentValues(), i;
+
+ // Fixing null values to match 2.50 behaviour '' == null
+ for(i in currentValues) {
+ if(currentValues.hasOwnProperty(i) &&
+ currentValues[i] === null) {
+ currentValues[i] = '';
+ }
+ }
+
return context && (${fieldDefinition.showIf});
},
</#if>
diff -r 78844a19c9a9 -r e88f79cba1a7
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl
Thu Feb 10 12:07:02 2011 +0100
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/ob-view-form.js.ftl
Thu Feb 10 12:10:58 2011 +0100
@@ -25,20 +25,20 @@
</#list>
],
onFieldChanged: function(form, item, value) {
- form = form || this;
- var context = this.view.getContextInfo(false, true),
- currentValues = form.view.getCurrentValues();
+ var f = form || this,
+ context = this.view.getContextInfo(false, true),
+ currentValues = f.view.getCurrentValues();
<#list data.fields as field>
<#if field.readOnlyIf != "">
- if (form.readOnly) {
- form.getItem('${field.name}').disable();
+ if (f.readOnly) {
+ f.getItem('${field.name}').disable();
} else if(${field.readOnlyIf}) {
- form.getItem('${field.name}').disable();
+ f.getItem('${field.name}').disable();
} else {
- form.getItem('${field.name}').enable();
+ f.getItem('${field.name}').enable();
}
</#if>
</#list>
- form.setFindNewFocusItem();
+ f.setFindNewFocusItem();
}
})
diff -r 78844a19c9a9 -r e88f79cba1a7
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
Thu Feb 10 12:07:02 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
Thu Feb 10 12:10:58 2011 +0100
@@ -756,7 +756,7 @@
this.messageBar.hide();
if (!this.isShowingForm) {
- this.switchFormGridVisibility();
+ this.viewForm.showFormOnFICReturn = true;
}
if (!record) { // new case
@@ -1423,7 +1423,7 @@
component = this.viewGrid.getEditForm();
form = component;
} else if (this.isShowingForm) {
- record = this.viewForm.getValues();
+ record = isc.addProperties({}, this.viewGrid.getSelectedRecord(),
this.viewForm.getValues());
component = this.viewForm;
form = component;
} else {
diff -r 78844a19c9a9 -r e88f79cba1a7
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Thu Feb 10 12:07:02 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Thu Feb 10 12:10:58 2011 +0100
@@ -305,8 +305,9 @@
this.auxInputs = {};
for (prop in auxInputs) {
if (auxInputs.hasOwnProperty(prop)) {
- this.setValue(prop, auxInputs[prop].value);
- this.auxInputs[prop] = auxInputs[prop].value;
+ value = typeof auxInputs[prop].value !== 'undefined' ?
auxInputs[prop].value : '';
+ this.setValue(prop, value);
+ this.auxInputs[prop] = value;
}
}
}
@@ -323,10 +324,6 @@
} else {
this.readOnly = false;
}
- this.view.toolBar.updateButtonState();
- // note onFieldChanged uses the form.readOnly set above
- this.onFieldChanged(this);
- this.focus();
// save out the values to the grid before redrawing
if (this.grid && this.grid.setEditValues && (this.grid.getEditRow() ||
this.grid.getEditRow() === 0)) {
@@ -346,6 +343,17 @@
}
this.markForRedraw();
+ if (this.showFormOnFICReturn) {
+ if (!this.isVisible()) {
+ this.view.switchFormGridVisibility();
+ }
+ delete this.showFormOnFICReturn;
+ }
+
+ this.view.toolBar.updateButtonState();
+ // note onFieldChanged uses the form.readOnly set above
+ this.onFieldChanged(this);
+ this.focus();
},
setDisabled: function(state) {
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits