Fixed issue 22901: Added 'clientClass' to OBGrid
authorDavid Baz Fayos <david.baz@openbravo.com>
Sat, 26 Jan 2013 17:16:16 +0100
changeset 19455 ef2e15e1a780
parent 19454 b1526c3b0148
child 19456 603290cb6a8a
Fixed issue 22901: Added 'clientClass' to OBGrid
to let use canvas based items in grids
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_QUERY_COLUMN.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml
modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListComponentProvider.java
modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-canvas-item.js
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js	Sat Jan 26 17:16:16 2013 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2012 Openbravo SLU
+ * All portions are Copyright (C) 2011-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -93,7 +93,7 @@
     title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Record'),
     canFilter: true,
     canEdit: false,
-    isLink: true,
+    clientClass: 'OBAlertGridCanvasItem_Link',
     filterOnKeypress: true,
     filterEditorType: 'OBTextItem',
     type: '_id_10',
@@ -212,19 +212,6 @@
     return this.Super('headerClick', arguments);
   },
 
-  cellClick: function (record, rowNum, colNum) {
-    var i, tabId, field = this.getField(colNum),
-        length = OB.AlertManagement.alertRules.length;
-    for (i = 0; i < length; i++) {
-      if (OB.AlertManagement.alertRules[i].alertRuleId === record.alertRule) {
-        tabId = OB.AlertManagement.alertRules[i].tabId;
-      }
-    }
-    if (field.isLink && tabId && tabId !== '') {
-      OB.Utilities.openDirectTab(tabId, record.referenceSearchKey);
-    }
-  },
-
   recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue) {
     this.handleRecordSelection(viewer, record, recordNum, field, fieldNum, value, rawValue, false, true);
   },
@@ -519,4 +506,23 @@
     this.Super('draw', arguments);
   }
 
+});
+
+isc.defineClass('OBAlertGridCanvasItem_Link', isc.OBGridLinkItem);
+
+isc.OBAlertGridCanvasItem_Link.addProperties({
+  setRecord: function () {
+    this.setTitle(this.grid.formatLinkValue(this.record, this.field, this.colNum, this.rowNum, this.record[this.field.name]));
+  },
+  doAction: function () {
+    var i, tabId, length = OB.AlertManagement.alertRules.length;
+    for (i = 0; i < length; i++) {
+      if (OB.AlertManagement.alertRules[i].alertRuleId === this.record.alertRule) {
+        tabId = OB.AlertManagement.alertRules[i].tabId;
+      }
+    }
+    if (tabId && tabId !== '') {
+      OB.Utilities.openDirectTab(tabId, this.record.referenceSearchKey);
+    }
+  }
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js	Sat Jan 26 17:16:16 2013 +0100
@@ -93,12 +93,11 @@
   overflow: 'visible',
 
   setRecord: function (record) {
-    var fld = this.grid.getField(this.fieldName),
-        val = record[this.fieldName];
-    if (fld && fld.type && isc.SimpleType.getType(fld.type).normalDisplayFormatter) {
-      this.showValue(isc.SimpleType.getType(fld.type).normalDisplayFormatter(val), val);
+    var val = record[this.field.name];
+    if (this.field && this.field.type && isc.SimpleType.getType(this.field.type).normalDisplayFormatter) {
+      this.showValue(isc.SimpleType.getType(this.field.type).normalDisplayFormatter(val), val);
     } else {
-      this.showValue(String(record[this.fieldName]));
+      this.showValue(String(record[this.field.name]));
     }
   },
 
@@ -124,12 +123,11 @@
   overflow: 'visible',
 
   setRecord: function (record) {
-    var fld = this.grid.getField(this.fieldName),
-        val = record[this.fieldName];
-    if (fld && fld.type && isc.SimpleType.getType(fld.type).normalDisplayFormatter) {
-      this.showValue(isc.SimpleType.getType(fld.type).normalDisplayFormatter(val), val);
+    var val = record[this.field.name];
+    if (this.field && this.field.type && isc.SimpleType.getType(this.field.type).normalDisplayFormatter) {
+      this.showValue(isc.SimpleType.getType(this.field.type).normalDisplayFormatter(val), val);
     } else {
-      this.showValue(String(record[this.fieldName]));
+      this.showValue(String(record[this.field.name]));
     }
   },
 
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Sat Jan 26 17:16:16 2013 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -169,17 +169,45 @@
 
   createRecordComponent: function (record, colNum) {
     var field = this.getField(colNum),
-        rowNum = this.getRecordIndex(record);
-    if (field.isLink && record[field.name]) {
-      var linkButton = isc.OBGridLinkLayout.create({
+        rowNum = this.getRecordIndex(record),
+        isEditRecord = rowNum === this.getEditRow(),
+        canvas, clientClass, clientClassPropsStartPosition, clientClassProps;
+
+    if (field.isLink && !field.clientClass && record[field.name]) {
+      // To keep compatibility with < 3.0MP20 versions that didn't implement 'clientClass' and only have 'isLink' property
+      field.clientClass = 'OBGridLinkCellClick';
+    }
+
+    if (field.clientClass && !isEditRecord) {
+      clientClass = field.clientClass;
+      clientClassPropsStartPosition = clientClass.indexOf('{');
+      if (clientClassPropsStartPosition > 0) {
+        clientClassProps = clientClass.substring(clientClassPropsStartPosition, clientClass.length);
+        try {
+          clientClassProps = JSON.parse(clientClassProps);
+        } catch (e) {
+          clientClassProps = {};
+        }
+        clientClass = clientClass.substring(0, clientClassPropsStartPosition);
+      } else {
+        clientClassProps = {};
+      }
+      clientClass = clientClass.replace(/\s+/g, '');
+
+      canvas = isc.ClassFactory.newInstance(clientClass, {
         grid: this,
         align: this.getCellAlign(record, rowNum, colNum),
-        title: this.formatLinkValue(record, field, colNum, rowNum, record[field.name]),
+        field: field,
         record: record,
         rowNum: rowNum,
         colNum: colNum
-      });
-      return linkButton;
+      }, clientClassProps);
+      if (canvas) {
+        if (canvas.setRecord) {
+          canvas.setRecord(record);
+        }
+        return canvas;
+      }
     }
     return null;
   },
@@ -187,17 +215,45 @@
   updateRecordComponent: function (record, colNum, component, recordChanged) {
     var field = this.getField(colNum),
         rowNum = this.getRecordIndex(record);
-    if (field.isLink && record[field.name]) {
-      component.setTitle(this.formatLinkValue(record, field, colNum, rowNum, record[field.name]));
+    if (field.clientClass) {
+      component.align = this.getCellAlign(record, rowNum, colNum);
+      component.field = field;
       component.record = record;
       component.rowNum = rowNum;
       component.colNum = colNum;
-      component.align = this.getCellAlign(record, rowNum, colNum);
+      if (component.setRecord) {
+        component.setRecord(record);
+      }
       return component;
     }
     return null;
   },
 
+  // recompute RecordComponents
+  recomputeCanvasComponents: function (rowNum) {
+    var i, fld, length = this.getFields().length;
+
+    // remove client record components in edit mode
+    for (i = 0; i < length; i++) {
+      fld = this.getFields()[i];
+      if (fld.clientClass) {
+        this.refreshRecordComponent(rowNum, i);
+      }
+    }
+  },
+
+  startEditing: function (rowNum, colNum, suppressFocus, eCe, suppressWarning) {
+    var ret = this.Super('startEditing', arguments);
+    this.recomputeCanvasComponents(rowNum);
+    return ret;
+  },
+
+  startEditingNew: function (rowNum) {
+    var ret = this.Super('startEditingNew', arguments);
+    this.recomputeCanvasComponents(rowNum + 1);
+    return ret;
+  },
+
   formatLinkValue: function (record, field, colNum, rowNum, value) {
     if (typeof value === 'undefined' || value === null) {
       return '';
@@ -408,7 +464,7 @@
   },
 
   initWidget: function () {
-    // prevent the value to be displayed in case of a link
+    // prevent the value to be displayed in case of a clientClass
     var i, length, field, formatCellValueFunction;
 
     formatCellValueFunction = function (value, record, rowNum, colNum, grid) {
@@ -430,7 +486,7 @@
           field.filterEditorProperties.criteriaField = field.criteriaField;
         }
 
-        if (field.isLink) {
+        if (field.clientClass) {
           // store the originalFormatCellValue if not already set
           if (field.formatCellValue && !field.formatCellValueFunctionReplaced) {
             field.originalFormatCellValue = field.formatCellValue;
@@ -731,8 +787,8 @@
 
 isc.ClassFactory.defineClass('OBGridHeaderImgButton', isc.ImgButton);
 
-isc.ClassFactory.defineClass('OBGridLinkLayout', isc.HLayout);
-isc.OBGridLinkLayout.addProperties({
+isc.ClassFactory.defineClass('OBGridLinkItem', isc.HLayout);
+isc.OBGridLinkItem.addProperties({
   overflow: 'clip-h',
   btn: null,
   height: 1,
@@ -748,16 +804,7 @@
 
   setTitle: function (title) {
     this.btn.setTitle(title);
-  },
-
-  doAction: function () {
-    if (this.grid && this.grid.doCellClick) {
-      this.grid.doCellClick(this.record, this.rowNum, this.colNum);
-    } else if (this.grid && this.grid.cellClick) {
-      this.grid.cellClick(this.record, this.rowNum, this.colNum);
-    }
   }
-
 });
 
 isc.ClassFactory.defineClass('OBGridLinkButton', isc.Button);
@@ -769,4 +816,21 @@
 });
 
 isc.ClassFactory.defineClass('OBGridFormButton', isc.OBFormButton);
-isc.OBGridFormButton.addProperties({});
\ No newline at end of file
+isc.OBGridFormButton.addProperties({});
+
+
+isc.defineClass('OBGridLinkCellClick', isc.OBGridLinkItem);
+
+isc.OBGridLinkCellClick.addProperties({
+  setRecord: function () {
+    this.setTitle(this.grid.formatLinkValue(this.record, this.field, this.colNum, this.rowNum, this.record[this.field.name]));
+  },
+
+  doAction: function () {
+    if (this.grid && this.grid.doCellClick) {
+      this.grid.doCellClick(this.record, this.rowNum, this.colNum);
+    } else if (this.grid && this.grid.cellClick) {
+      this.grid.cellClick(this.record, this.rowNum, this.colNum);
+    }
+  }
+});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sat Jan 26 17:16:16 2013 +0100
@@ -2481,8 +2481,6 @@
 
     ret = this.Super('startEditing', [rowNum, colNum, suppressFocus, eCe, suppressWarning]);
 
-    this.recomputeCanvasComponents(rowNum);
-
     return ret;
   },
 
@@ -2508,19 +2506,6 @@
     this.view.refreshChildViews();
   },
 
-  // recompute recordcomponents
-  recomputeCanvasComponents: function (rowNum) {
-    var i, fld, length = this.getFields().length;
-
-    // remove client record components in edit mode
-    for (i = 0; i < length; i++) {
-      fld = this.getFields()[i];
-      if (fld.clientClass) {
-        this.refreshRecordComponent(rowNum, i);
-      }
-    }
-  },
-
   initializeEditValues: function (rowNum, colNum) {
     var record = this.getRecord(rowNum);
     // no record create one
@@ -2694,10 +2679,6 @@
     var fld = this.getFields()[colNum],
         index;
 
-    if (fld.clientClass) {
-      return '';
-    }
-
     if (this.inCellHoverHTML || !isc.isA.String(value)) {
       return value;
     }
@@ -3343,21 +3324,8 @@
         layout.showEditOpen();
       }
       return layout;
-    }
-    if (fld.clientClass && !isEditRecord) {
-      canvas = isc.ClassFactory.newInstance(fld.clientClass, {
-        grid: this,
-        fieldName: fld.name,
-        rowNum: rowNum,
-        record: record,
-        colNum: colNum
-      });
-      if (canvas) {
-        if (canvas.setRecord) {
-          canvas.setRecord(record);
-        }
-        return canvas;
-      }
+    } else {
+      return this.Super('createRecordComponent', arguments);
     }
   },
 
@@ -3380,12 +3348,7 @@
     } else if (isEditRecord) {
       return null;
     } else {
-      if (component.setRecord) {
-        component.setRecord(record);
-      } else {
-        component.record = record;
-      }
-      component.rowNum = rowNum;
+      return this.Super('updateRecordComponent', arguments);
     }
     return component;
   },
--- a/modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_QUERY_COLUMN.xml	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_QUERY_COLUMN.xml	Sat Jan 26 17:16:16 2013 +0100
@@ -89,6 +89,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="CLIENTCLASS" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_TAB" name="OBCQL_QUERY_COLUMN_ADTAB">
         <reference local="AD_TAB_ID" foreign="AD_TAB_ID"/>
       </foreign-key>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml	Sat Jan 26 17:16:16 2013 +0100
@@ -1,5 +1,38 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--7BECD62B817F4D88A19FE84DABD3E15C--><AD_COLUMN>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_COLUMN_ID><![CDATA[7BECD62B817F4D88A19FE84DABD3E15C]]></AD_COLUMN_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <NAME><![CDATA[Client Class]]></NAME>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <COLUMNNAME><![CDATA[Clientclass]]></COLUMNNAME>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_TABLE_ID><![CDATA[8EE7634FA71B40FDB9ADF85374264BF6]]></AD_TABLE_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <FIELDLENGTH><![CDATA[255]]></FIELDLENGTH>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <SEQNO><![CDATA[230]]></SEQNO>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_ELEMENT_ID><![CDATA[3269E9900D0C45BB9CDA1BF2975242ED]]></AD_ELEMENT_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <POSITION><![CDATA[23]]></POSITION>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--7BECD62B817F4D88A19FE84DABD3E15C-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--7BECD62B817F4D88A19FE84DABD3E15C--></AD_COLUMN>
+
 <!--81001DA1F1D44C10979E937B1754307F--><AD_COLUMN>
 <!--81001DA1F1D44C10979E937B1754307F-->  <AD_COLUMN_ID><![CDATA[81001DA1F1D44C10979E937B1754307F]]></AD_COLUMN_ID>
 <!--81001DA1F1D44C10979E937B1754307F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml	Sat Jan 26 17:16:16 2013 +0100
@@ -29,6 +29,33 @@
 <!--82D5C58E310948088A4FE87611B1D84A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--82D5C58E310948088A4FE87611B1D84A--></AD_FIELD>
 
+<!--8D2BF09D6ED74C92A5E107F18E197DD2--><AD_FIELD>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <AD_FIELD_ID><![CDATA[8D2BF09D6ED74C92A5E107F18E197DD2]]></AD_FIELD_ID>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <NAME><![CDATA[Clientclass]]></NAME>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <AD_TAB_ID><![CDATA[15F16613CF764D948B2B2163F7A9CFF8]]></AD_TAB_ID>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <AD_COLUMN_ID><![CDATA[7BECD62B817F4D88A19FE84DABD3E15C]]></AD_COLUMN_ID>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <DISPLAYLENGTH><![CDATA[255]]></DISPLAYLENGTH>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <SEQNO><![CDATA[150]]></SEQNO>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <GRID_SEQNO><![CDATA[150]]></GRID_SEQNO>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--8D2BF09D6ED74C92A5E107F18E197DD2--></AD_FIELD>
+
 <!--90A30A5448AB4813BECCD8804DFF8592--><AD_FIELD>
 <!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_FIELD_ID><![CDATA[90A30A5448AB4813BECCD8804DFF8592]]></AD_FIELD_ID>
 <!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListComponentProvider.java	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListComponentProvider.java	Sat Jan 26 17:16:16 2013 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -51,6 +51,8 @@
         "web/org.openbravo.client.querylist/js/ob-querylist-widget.js", false));
     globalResources.add(createStaticResource(
         "web/org.openbravo.client.querylist/js/ob-querylist-view.js", false));
+    globalResources.add(createStaticResource(
+        "web/org.openbravo.client.querylist/js/ob-querylist-canvas-item.js", false));
 
     globalResources.add(createStaticResource(
         "web/org.openbravo.userinterface.smartclient/openbravo/skins/"
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java	Sat Jan 26 17:16:16 2013 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -83,6 +83,10 @@
             field.put("showGridSummary", false);
           }
 
+          if (column.getClientClass() != null) {
+            field.put("clientClass", column.getClientClass());
+          }
+
           field.put("canExport", true);
           if ("E".equals(column.getIncludeIn())
               || ("M".equals(column.getIncludeIn()) && includeIn.equals(IncludeIn.WidgetView))) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-canvas-item.js	Sat Jan 26 17:16:16 2013 +0100
@@ -0,0 +1,32 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2013 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+isc.defineClass('OBQLCanvasItem_Link', isc.OBGridLinkItem);
+
+isc.OBQLCanvasItem_Link.addProperties({
+  setRecord: function () {
+    this.setTitle(this.grid.formatLinkValue(this.record, this.field, this.colNum, this.rowNum, this.record[this.field.name]));
+  },
+  doAction: function () {
+    if (this.field.OB_TabId && this.field.OB_LinkExpression) {
+      //To open the tab provided in the widget column. Refer https://issues.openbravo.com/view.php?id=17411.
+      OB.Utilities.openDirectTab(this.field.OB_TabId, this.record[this.field.OB_LinkExpression]);
+    }
+  }
+});
--- a/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Sat Jan 26 02:21:59 2013 +0100
+++ b/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Sat Jan 26 17:16:16 2013 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -37,6 +37,7 @@
   OBQueryListShowAllLabelHeight: null,
 
   initWidget: function () {
+    var field, i;
     this.showAllLabel = isc.HLayout.create({
       height: this.OBQueryListShowAllLabelHeight,
       members: [
@@ -53,6 +54,16 @@
 
     this.gridDataSource = this.createGridDataSource();
 
+    // To use 'OBQLCanvasItem_Link' clientClass in case we have just a simple 'link' (with no clientClass defined)
+    if (this.fields) {
+      for (i = 0; i < this.fields.length; i++) {
+        field = this.fields[i];
+        if (field.isLink && !field.clientClass) {
+          field.clientClass = 'OBQLCanvasItem_Link';
+        }
+      }
+    }
+
     this.Super('initWidget', arguments);
     this.widgetTitle = this.title;
     // refresh if the dbInstanceId is set
@@ -310,16 +321,6 @@
     return this.Super('fetchData', [crit, newCallBack, reqProperties]);
   },
 
-  cellClick: function (record, rowNum, colNum) {
-    var field = this.getField(colNum);
-    if (field.isLink) {
-      if (field.OB_TabId && field.OB_LinkExpression) {
-        //To open the tab provided in the widget column. Refer https://issues.openbravo.com/view.php?id=17411.
-        OB.Utilities.openDirectTab(field.OB_TabId, record[field.OB_LinkExpression]);
-      }
-    }
-  },
-
   getWidgetTotalRows: function (dsResponse, data, dsRequest) {
     if (this.widget.viewMode === 'widget' && !this.widget.parameters.showAll) {
       var criteria = dsResponse.clientContext.criteria || {},