details: /erp/devel/pi/rev/d064fcda04f1
changeset: 9752:d064fcda04f1
user: Martin Taal <martin.taal <at> openbravo.com>
date: Thu Jan 13 07:04:22 2011 +0100
summary: Changed readonly logic to not disable section items
details: /erp/devel/pi/rev/934abef965c2
changeset: 9753:934abef965c2
user: Martin Taal <martin.taal <at> openbravo.com>
date: Thu Jan 13 07:05:37 2011 +0100
summary: Changed readonly logic to not disable section items
details: /erp/devel/pi/rev/c6cdf4a358a7
changeset: 9754:c6cdf4a358a7
user: Martin Taal <martin.taal <at> openbravo.com>
date: Thu Jan 13 07:06:26 2011 +0100
summary: Enabled popup text area for text fields in grid editing
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
| 15 ++++++---
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
| 6 +++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
| 4 +-
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TextUIDefinition.java
| 5 +++
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
| 3 +-
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
| 4 ++
6 files changed, 28 insertions(+), 9 deletions(-)
diffs (120 lines):
diff -r bce27f7b41c4 -r c6cdf4a358a7
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
Thu Jan 13 06:57:33 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
Thu Jan 13 07:06:26 2011 +0100
@@ -79,6 +79,8 @@
length = parameters.length;
for (i = 0; i < length; i++) {
hiddenInputName = ((parameters[i].esRef) ? targetFld.inpColumnName :
'') + parameters[i].campo;
+ // Revisit for grid editor, maybe setting the value in the form will
set it
+ // in the record to be kepped there
targetFld.form.hiddenInputs[hiddenInputName] = parameters[i].valor;
}
}
@@ -275,6 +277,14 @@
validateOnExit: true
});
+// used in the grid
+isc.ClassFactory.defineClass('OBPopUpTextAreaItem', PopUpTextAreaItem);
+
+isc.OBPopUpTextAreaItem.addProperties({
+ validateOnExit: true,
+ popUpOnEnter: true
+});
+
// == OBSectionItem ==
// Form sections
isc.ClassFactory.defineClass('OBSectionItem', SectionItem);
@@ -289,11 +299,6 @@
return ret;
},
- updateDisabled: function(){
- var ret = this.Super('initWidget', arguments);
- return ret;
- },
-
// never disable a section item
isDisabled: function(){
return false;
diff -r bce27f7b41c4 -r c6cdf4a358a7
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 Jan 13 06:57:33 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
Thu Jan 13 07:06:26 2011 +0100
@@ -375,6 +375,10 @@
view: this.viewForm.view
});
+ // NOTE: when changing the layout structure and the scrollbar
+ // location for these layouts check if the scrollTo method
+ // in ob-view-form-linked-items is still called on the correct
+ // object
this.statusBarFormLayout = isc.VLayout.create({
width: '100%',
height: '*',
@@ -456,7 +460,7 @@
setReadOnly: function(readOnly){
this.readOnly = readOnly;
if (readOnly) {
- this.viewForm.disable();
+ this.viewForm.readOnly = true;
this.toolBar.setLeftMemberDisabled(isc.OBToolbar.TYPE_NEW, true);
this.toolBar.setLeftMemberDisabled(isc.OBToolbar.TYPE_SAVE, true);
this.toolBar.setLeftMemberDisabled(isc.OBToolbar.TYPE_UNDO, true);
diff -r bce27f7b41c4 -r c6cdf4a358a7
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 Jan 13 06:57:33 2011 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Thu Jan 13 07:06:26 2011 +0100
@@ -238,12 +238,12 @@
this.dynamicCols = dynamicCols;
}
if (!data.writable || this.view.readOnly) {
- this.disable();
+ this.readOnly = true;
this.view.toolBar.setLeftMemberDisabled(isc.OBToolbar.TYPE_SAVE, true);
this.view.toolBar.setLeftMemberDisabled(isc.OBToolbar.TYPE_UNDO, true);
this.view.toolBar.setLeftMemberDisabled(isc.OBToolbar.TYPE_DELETE, true);
} else {
- this.setDisabled(false);
+ this.readOnly = false;
}
},
diff -r bce27f7b41c4 -r c6cdf4a358a7
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TextUIDefinition.java
---
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TextUIDefinition.java
Thu Jan 13 06:57:33 2011 +0100
+++
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TextUIDefinition.java
Thu Jan 13 07:06:26 2011 +0100
@@ -41,4 +41,9 @@
public String getFilterEditorType() {
return "OBText";
}
+
+ @Override
+ public String getGridEditorType() {
+ return "OBPopUpTextAreaItem";
+ }
}
diff -r bce27f7b41c4 -r c6cdf4a358a7
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
Thu Jan 13 06:57:33 2011 +0100
+++
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
Thu Jan 13 07:06:26 2011 +0100
@@ -257,7 +257,8 @@
* @return a JSONObject string which is used to initialize the formitem.
*/
public String getGridFieldProperties(Field field) {
- return ", name: '" + getGridFieldName(field) + "', canExport: true,
canHide: true";
+ return ", name: '" + getGridFieldName(field)
+ + "', canExport: true, canHide: true, editorType: '" +
this.getGridEditorType() + "'";
}
/**
diff -r bce27f7b41c4 -r c6cdf4a358a7
modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
---
a/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Thu Jan 13 06:57:33 2011 +0100
+++
b/modules/org.openbravo.userinterface.smartclient/web/org.openbravo.userinterface.smartclient/js/ob-smartclient.js
Thu Jan 13 07:06:26 2011 +0100
@@ -64,6 +64,10 @@
return this._originalBlur(form, item);
}
return;
+ },
+
+ isDisabled: function() {
+ return this.form.readOnly;
}
});
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits