details:   /erp/devel/pi/rev/7d3b7d149bd2
changeset: 9958:7d3b7d149bd2
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Jan 20 06:48:21 2011 +0100
summary:   Prevent npe in js in toolbar

details:   /erp/devel/pi/rev/56b019853455
changeset: 9959:56b019853455
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Thu Jan 20 06:48:59 2011 +0100
summary:   Remove extra output escaping as freemarker already does this

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
 |  10 ++--------
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
      |   5 ++++-
 2 files changed, 6 insertions(+), 9 deletions(-)

diffs (42 lines):

diff -r e4c04b225294 -r 56b019853455 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
       Thu Jan 20 06:46:06 2011 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
       Thu Jan 20 06:48:59 2011 +0100
@@ -330,11 +330,6 @@
     private String command;
 
     public String getLabel() {
-      // this type of escaping not needed for javascript
-      // gives jslint warnings
-      if (label.contains("\\>")) {
-        return label.replace("\\>", ">");
-      }
       return label;
     }
 
@@ -355,9 +350,8 @@
       private String labelValue;
 
       public Value(org.openbravo.model.ad.domain.List valueList) {
-        labelValue = OBViewUtil.getLabel(valueList, 
valueList.getADListTrlList()).replace("\\", "");
-        // get rid of the \ as jslint and js can't handle them
-        value = valueList.getSearchKey().replace("\\", "");
+        labelValue = OBViewUtil.getLabel(valueList, 
valueList.getADListTrlList());
+        value = valueList.getSearchKey();
       }
 
       public String getValue() {
diff -r e4c04b225294 -r 56b019853455 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
    Thu Jan 20 06:46:06 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-toolbar.js
    Thu Jan 20 06:48:59 2011 +0100
@@ -563,7 +563,10 @@
   //
   refreshCustomButtons: function(){
     var buttons = this.getRightMembers();
-    var numOfSelRecords = this.view.viewGrid.getSelectedRecords().length;
+    var numOfSelRecords = 0; 
+    if (this.view.viewGrid.getSelectedRecords()) {
+      numOfSelRecords = this.view.viewGrid.getSelectedRecords().length;
+    }
     var isNew = this.view.viewForm.isNew;
     var hideAllButtons = !isNew && (!this.view.viewGrid.getSelectedRecords() 
|| this.view.viewGrid.getSelectedRecords().length !== 1);
     var currentValues = this.view.getCurrentValues();

------------------------------------------------------------------------------
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

Reply via email to