[OBCQL] Implemented click action on cells with links to tab.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 15 Dec 2010 19:12:05 +0100
changeset 9176 99808e693803
parent 9175 a63ac3a9796e
child 9177 1d75b1838448
[OBCQL] Implemented click action on cells with links to tab.
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_ELEMENT.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_QUERY_COLUMN.xml
modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.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-widget.js
--- a/modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_QUERY_COLUMN.xml	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_QUERY_COLUMN.xml	Wed Dec 15 19:12:05 2010 +0100
@@ -73,6 +73,14 @@
         <default><![CDATA[W]]></default>
         <onCreateDefault/>
       </column>
+      <column name="HAS_LINK" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_TAB_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="OBCQL_QUERY_COLUMN_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -89,5 +97,6 @@
         <reference local="AD_REFERENCE_ID" foreign="AD_REFERENCE_ID"/>
       </foreign-key>
       <check name="OBCQL_QUERY_COLUMN_ACTIVECHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+      <check name="OBCQL_QUERY_COLUMN_HASLINK"><![CDATA[HAS_LINK IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml	Wed Dec 15 19:12:05 2010 +0100
@@ -1344,4 +1344,70 @@
 <!--96FCF4C1EFA1AE63E040007F01002B87-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--96FCF4C1EFA1AE63E040007F01002B87--></AD_COLUMN>
 
+<!--97735A85B530BEE5E040007F0100334A--><AD_COLUMN>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_COLUMN_ID><![CDATA[97735A85B530BEE5E040007F0100334A]]></AD_COLUMN_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--97735A85B530BEE5E040007F0100334A-->  <NAME><![CDATA[Has Link]]></NAME>
+<!--97735A85B530BEE5E040007F0100334A-->  <HELP><![CDATA[Flag to set that the field of the grid will have a link]]></HELP>
+<!--97735A85B530BEE5E040007F0100334A-->  <COLUMNNAME><![CDATA[Has_Link]]></COLUMNNAME>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_TABLE_ID><![CDATA[8EE7634FA71B40FDB9ADF85374264BF6]]></AD_TABLE_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--97735A85B530BEE5E040007F0100334A-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--97735A85B530BEE5E040007F0100334A-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_ELEMENT_ID><![CDATA[977365E5A94B3B33E040007F010031AE]]></AD_ELEMENT_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--97735A85B530BEE5E040007F0100334A-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--97735A85B530BEE5E040007F0100334A-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--97735A85B530BEE5E040007F0100334A-->  <POSITION><![CDATA[19]]></POSITION>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--97735A85B530BEE5E040007F0100334A-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--97735A85B530BEE5E040007F0100334A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--97735A85B530BEE5E040007F0100334A--></AD_COLUMN>
+
+<!--97735A85B531BEE5E040007F0100334A--><AD_COLUMN>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_COLUMN_ID><![CDATA[97735A85B531BEE5E040007F0100334A]]></AD_COLUMN_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--97735A85B531BEE5E040007F0100334A-->  <NAME><![CDATA[Tab]]></NAME>
+<!--97735A85B531BEE5E040007F0100334A-->  <DESCRIPTION><![CDATA[An indication that a tab is displayed within a window.]]></DESCRIPTION>
+<!--97735A85B531BEE5E040007F0100334A-->  <HELP><![CDATA[The Tab indicates a tab that displays within a window.]]></HELP>
+<!--97735A85B531BEE5E040007F0100334A-->  <COLUMNNAME><![CDATA[AD_Tab_ID]]></COLUMNNAME>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_TABLE_ID><![CDATA[8EE7634FA71B40FDB9ADF85374264BF6]]></AD_TABLE_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--97735A85B531BEE5E040007F0100334A-->  <SEQNO><![CDATA[200]]></SEQNO>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_ELEMENT_ID><![CDATA[125]]></AD_ELEMENT_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--97735A85B531BEE5E040007F0100334A-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--97735A85B531BEE5E040007F0100334A-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--97735A85B531BEE5E040007F0100334A-->  <POSITION><![CDATA[20]]></POSITION>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--97735A85B531BEE5E040007F0100334A-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--97735A85B531BEE5E040007F0100334A-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--97735A85B531BEE5E040007F0100334A--></AD_COLUMN>
+
 </data>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Dec 15 19:12:05 2010 +0100
@@ -100,4 +100,16 @@
 <!--96FCF80A354DB74FE040007F01002B7F-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
 <!--96FCF80A354DB74FE040007F01002B7F--></AD_ELEMENT>
 
+<!--977365E5A94B3B33E040007F010031AE--><AD_ELEMENT>
+<!--977365E5A94B3B33E040007F010031AE-->  <AD_ELEMENT_ID><![CDATA[977365E5A94B3B33E040007F010031AE]]></AD_ELEMENT_ID>
+<!--977365E5A94B3B33E040007F010031AE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--977365E5A94B3B33E040007F010031AE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--977365E5A94B3B33E040007F010031AE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--977365E5A94B3B33E040007F010031AE-->  <COLUMNNAME><![CDATA[Has_Link]]></COLUMNNAME>
+<!--977365E5A94B3B33E040007F010031AE-->  <NAME><![CDATA[Has Link]]></NAME>
+<!--977365E5A94B3B33E040007F010031AE-->  <PRINTNAME><![CDATA[Has Link]]></PRINTNAME>
+<!--977365E5A94B3B33E040007F010031AE-->  <HELP><![CDATA[Flag to set that the field of the grid will have a link]]></HELP>
+<!--977365E5A94B3B33E040007F010031AE-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--977365E5A94B3B33E040007F010031AE--></AD_ELEMENT>
+
 </data>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml	Wed Dec 15 19:12:05 2010 +0100
@@ -243,16 +243,17 @@
 <!--95CC803CC75D9A85E040007F010076A9-->  <AD_TAB_ID><![CDATA[15F16613CF764D948B2B2163F7A9CFF8]]></AD_TAB_ID>
 <!--95CC803CC75D9A85E040007F010076A9-->  <AD_COLUMN_ID><![CDATA[95CC63FD04C821F2E040007F010075C1]]></AD_COLUMN_ID>
 <!--95CC803CC75D9A85E040007F010076A9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--95CC803CC75D9A85E040007F010076A9-->  <DISPLAYLOGIC><![CDATA[@has_link@='Y']]></DISPLAYLOGIC>
 <!--95CC803CC75D9A85E040007F010076A9-->  <DISPLAYLENGTH><![CDATA[255]]></DISPLAYLENGTH>
 <!--95CC803CC75D9A85E040007F010076A9-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--95CC803CC75D9A85E040007F010076A9-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--95CC803CC75D9A85E040007F010076A9-->  <SEQNO><![CDATA[110]]></SEQNO>
 <!--95CC803CC75D9A85E040007F010076A9-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--95CC803CC75D9A85E040007F010076A9-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--95CC803CC75D9A85E040007F010076A9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--95CC803CC75D9A85E040007F010076A9-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--95CC803CC75D9A85E040007F010076A9-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--95CC803CC75D9A85E040007F010076A9-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
-<!--95CC803CC75D9A85E040007F010076A9-->  <GRID_SEQNO><![CDATA[90]]></GRID_SEQNO>
+<!--95CC803CC75D9A85E040007F010076A9-->  <GRID_SEQNO><![CDATA[110]]></GRID_SEQNO>
 <!--95CC803CC75D9A85E040007F010076A9--></AD_FIELD>
 
 <!--95CC803CC75F9A85E040007F010076A9--><AD_FIELD>
@@ -361,14 +362,14 @@
 <!--95CC803CC7679A85E040007F010076A9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--95CC803CC7679A85E040007F010076A9-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
 <!--95CC803CC7679A85E040007F010076A9-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--95CC803CC7679A85E040007F010076A9-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--95CC803CC7679A85E040007F010076A9-->  <SEQNO><![CDATA[130]]></SEQNO>
 <!--95CC803CC7679A85E040007F010076A9-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--95CC803CC7679A85E040007F010076A9-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--95CC803CC7679A85E040007F010076A9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
 <!--95CC803CC7679A85E040007F010076A9-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--95CC803CC7679A85E040007F010076A9-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--95CC803CC7679A85E040007F010076A9-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
-<!--95CC803CC7679A85E040007F010076A9-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--95CC803CC7679A85E040007F010076A9-->  <GRID_SEQNO><![CDATA[120]]></GRID_SEQNO>
 <!--95CC803CC7679A85E040007F010076A9--></AD_FIELD>
 
 <!--95CC803CC7699A85E040007F010076A9--><AD_FIELD>
@@ -651,4 +652,52 @@
 <!--96FCF4C1EFB0AE63E040007F01002B87-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
 <!--96FCF4C1EFB0AE63E040007F01002B87--></AD_FIELD>
 
+<!--97735A85B532BEE5E040007F0100334A--><AD_FIELD>
+<!--97735A85B532BEE5E040007F0100334A-->  <AD_FIELD_ID><![CDATA[97735A85B532BEE5E040007F0100334A]]></AD_FIELD_ID>
+<!--97735A85B532BEE5E040007F0100334A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--97735A85B532BEE5E040007F0100334A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--97735A85B532BEE5E040007F0100334A-->  <NAME><![CDATA[Tab]]></NAME>
+<!--97735A85B532BEE5E040007F0100334A-->  <DESCRIPTION><![CDATA[An indication that a tab is displayed within a window.]]></DESCRIPTION>
+<!--97735A85B532BEE5E040007F0100334A-->  <HELP><![CDATA[Indicates the tab the link points to. The link expression in this case has to be a column alias of the query containing an UUID identifier of a record of the selected tab.]]></HELP>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
+<!--97735A85B532BEE5E040007F0100334A-->  <AD_TAB_ID><![CDATA[15F16613CF764D948B2B2163F7A9CFF8]]></AD_TAB_ID>
+<!--97735A85B532BEE5E040007F0100334A-->  <AD_COLUMN_ID><![CDATA[97735A85B531BEE5E040007F0100334A]]></AD_COLUMN_ID>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--97735A85B532BEE5E040007F0100334A-->  <DISPLAYLOGIC><![CDATA[@has_link@='Y']]></DISPLAYLOGIC>
+<!--97735A85B532BEE5E040007F0100334A-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--97735A85B532BEE5E040007F0100334A-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--97735A85B532BEE5E040007F0100334A-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--97735A85B532BEE5E040007F0100334A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--97735A85B532BEE5E040007F0100334A-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--97735A85B532BEE5E040007F0100334A-->  <GRID_SEQNO><![CDATA[100]]></GRID_SEQNO>
+<!--97735A85B532BEE5E040007F0100334A--></AD_FIELD>
+
+<!--97735A85B534BEE5E040007F0100334A--><AD_FIELD>
+<!--97735A85B534BEE5E040007F0100334A-->  <AD_FIELD_ID><![CDATA[97735A85B534BEE5E040007F0100334A]]></AD_FIELD_ID>
+<!--97735A85B534BEE5E040007F0100334A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--97735A85B534BEE5E040007F0100334A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--97735A85B534BEE5E040007F0100334A-->  <NAME><![CDATA[Has Link]]></NAME>
+<!--97735A85B534BEE5E040007F0100334A-->  <HELP><![CDATA[Flag to set that the field of the grid will have a link]]></HELP>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--97735A85B534BEE5E040007F0100334A-->  <AD_TAB_ID><![CDATA[15F16613CF764D948B2B2163F7A9CFF8]]></AD_TAB_ID>
+<!--97735A85B534BEE5E040007F0100334A-->  <AD_COLUMN_ID><![CDATA[97735A85B530BEE5E040007F0100334A]]></AD_COLUMN_ID>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--97735A85B534BEE5E040007F0100334A-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--97735A85B534BEE5E040007F0100334A-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--97735A85B534BEE5E040007F0100334A-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--97735A85B534BEE5E040007F0100334A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--97735A85B534BEE5E040007F0100334A-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--97735A85B534BEE5E040007F0100334A-->  <GRID_SEQNO><![CDATA[90]]></GRID_SEQNO>
+<!--97735A85B534BEE5E040007F0100334A--></AD_FIELD>
+
 </data>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_QUERY_COLUMN.xml	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_QUERY_COLUMN.xml	Wed Dec 15 19:12:05 2010 +0100
@@ -9,9 +9,12 @@
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <DISPLAY_EXPRESSION><![CDATA[tabName]]></DISPLAY_EXPRESSION>
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <NAME><![CDATA[Tab name]]></NAME>
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <WIDTH><![CDATA[110]]></WIDTH>
+<!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <LINK_EXPRESSION><![CDATA[tabId]]></LINK_EXPRESSION>
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <SEQNO><![CDATA[20]]></SEQNO>
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <INCLUDE_IN><![CDATA[W]]></INCLUDE_IN>
+<!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <HAS_LINK><![CDATA[Y]]></HAS_LINK>
+<!--1B0F7BAEABF54A8EAB2CAA5A04A107DB-->  <AD_TAB_ID><![CDATA[106]]></AD_TAB_ID>
 <!--1B0F7BAEABF54A8EAB2CAA5A04A107DB--></OBCQL_QUERY_COLUMN>
 
 <!--21C941CEA93D4E5D839470FE1F9D9AB2--><OBCQL_QUERY_COLUMN>
@@ -26,6 +29,7 @@
 <!--21C941CEA93D4E5D839470FE1F9D9AB2-->  <SEQNO><![CDATA[10]]></SEQNO>
 <!--21C941CEA93D4E5D839470FE1F9D9AB2-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
 <!--21C941CEA93D4E5D839470FE1F9D9AB2-->  <INCLUDE_IN><![CDATA[W]]></INCLUDE_IN>
+<!--21C941CEA93D4E5D839470FE1F9D9AB2-->  <HAS_LINK><![CDATA[N]]></HAS_LINK>
 <!--21C941CEA93D4E5D839470FE1F9D9AB2--></OBCQL_QUERY_COLUMN>
 
 <!--538673CEF1D04E71B0D27DF9A3C34594--><OBCQL_QUERY_COLUMN>
@@ -40,6 +44,7 @@
 <!--538673CEF1D04E71B0D27DF9A3C34594-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--538673CEF1D04E71B0D27DF9A3C34594-->  <AD_REFERENCE_ID><![CDATA[13]]></AD_REFERENCE_ID>
 <!--538673CEF1D04E71B0D27DF9A3C34594-->  <INCLUDE_IN><![CDATA[E]]></INCLUDE_IN>
+<!--538673CEF1D04E71B0D27DF9A3C34594-->  <HAS_LINK><![CDATA[N]]></HAS_LINK>
 <!--538673CEF1D04E71B0D27DF9A3C34594--></OBCQL_QUERY_COLUMN>
 
 </data>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml	Wed Dec 15 19:12:05 2010 +0100
@@ -6,7 +6,7 @@
 <!--C0A8491CDB43466D9F2645018473588B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C0A8491CDB43466D9F2645018473588B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C0A8491CDB43466D9F2645018473588B-->  <OBKMO_WIDGET_CLASS_ID><![CDATA[D1E4261099AE4095B2F2DAEE0F7E7784]]></OBKMO_WIDGET_CLASS_ID>
-<!--C0A8491CDB43466D9F2645018473588B-->  <HQL><![CDATA[select tab.window.name as windowName, tab.name as tabName, tab.id as tabId
+<!--C0A8491CDB43466D9F2645018473588B-->  <HQL><![CDATA[select tab.window.name as windowName, tab.name as tabName, tab.id as tabId, tab.window.id as windowId
 from ADTab tab
 where window.name like :window_name
   and window.client.id = :client
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java	Wed Dec 15 19:12:05 2010 +0100
@@ -115,9 +115,7 @@
         for (OBCQL_QueryColumn column : columns) {
           // TODO: throw an exception if the display expression doesn't match any returned alias.
           for (int i = 0; i < queryAliases.length; i++) {
-            if (column.getDisplayExpression().equals(queryAliases[i])) {
-              data.put(column.getName(), resultList[i]);
-            }
+            data.put(queryAliases[i], resultList[i]);
           }
         }
         result.add(data);
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListUtils.java	Wed Dec 15 19:12:05 2010 +0100
@@ -26,12 +26,21 @@
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Expression;
 import org.openbravo.base.exception.OBException;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
 import org.openbravo.client.kernel.reference.UIDefinition;
 import org.openbravo.client.kernel.reference.UIDefinitionController;
 import org.openbravo.client.myob.WidgetClass;
+import org.openbravo.dal.core.DalUtil;
+import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.data.Sqlc;
+import org.openbravo.model.ad.domain.ModelImplementation;
+import org.openbravo.model.ad.domain.ModelImplementationMapping;
 import org.openbravo.model.ad.domain.Reference;
+import org.openbravo.model.ad.ui.Tab;
+import org.openbravo.model.ad.ui.WindowTrl;
 
 public class QueryListUtils {
   private static final Logger log = Logger.getLogger(QueryListUtils.class);
@@ -43,7 +52,6 @@
         for (OBCQL_QueryColumn column : QueryListUtils.getColumns(widgetClass
             .getOBCQLWidgetQueryList().get(0), includeIn)) {
           final JSONObject field = new JSONObject();
-          field.put("name", column.getName());
           final Reference reference;
           if (column.getReferenceSearchKey() != null) {
             reference = column.getReferenceSearchKey();
@@ -52,7 +60,55 @@
           }
           final UIDefinition uiDefinition = UIDefinitionController.getInstance().getUIDefinition(
               reference);
+          field.put("name", column.getDisplayExpression());
           field.put("type", uiDefinition.getName());
+          if (column.isHasLink()) {
+            field.put("OB_HasLink", true);
+            field.put("OB_LinkExpression", column.getLinkExpression());
+            final Tab tab = column.getTab();
+            final Entity entity = ModelProvider.getInstance().getEntity(tab.getTable().getName());
+
+            field.put("OB_TabId", tab.getId());
+            field.put("OB_WindowId", tab.getWindow().getId());
+
+            final String userLanguageId = OBContext.getOBContext().getLanguage().getId();
+            String tabTitle = null;
+            for (WindowTrl windowTrl : tab.getWindow().getADWindowTrlList()) {
+              final String trlLanguageId = (String) DalUtil.getId(windowTrl.getLanguage());
+              if (trlLanguageId.equals(userLanguageId)) {
+                tabTitle = windowTrl.getName();
+              }
+            }
+            if (tabTitle == null) {
+              tabTitle = tab.getWindow().getName();
+            }
+
+            field.put("OB_WindowTitle", tabTitle);
+            field.put("OB_keyParameter", "inp"
+                + Sqlc.TransformaNombreColumna(entity.getIdProperties().get(0).getColumnName()));
+            // find the model object mapping
+            String mappingName = null;
+            for (ModelImplementation modelImpl : tab.getADModelImplementationList()) {
+              for (ModelImplementationMapping mapping : modelImpl
+                  .getADModelImplementationMappingList()) {
+                if (mapping.getMappingName() != null
+                    && mapping.getMappingName().toLowerCase().contains("edition")) {
+                  // found it
+                  mappingName = mapping.getMappingName();
+                  break;
+                }
+              }
+              if (mappingName != null) {
+                break;
+              }
+            }
+            if (mappingName != null) {
+              field.put("OB_mappingName", mappingName);
+            }
+
+          } else {
+            field.put("OB_HasLink", false);
+          }
           try {
             final String fieldProperties = uiDefinition.getFieldProperties(null);
             if (fieldProperties != null && fieldProperties.trim().length() > 0) {
@@ -117,12 +173,13 @@
 
   private static String getColumnLabel(OBCQL_QueryColumn column) {
 
-    // TODO: Add column label translation
-    /*
-     * final String userLanguageId = OBContext.getOBContext().getLanguage().getId(); for
-     * (ParameterTrl trl : parameter.getOBUIAPPParameterTrlList()) { if
-     * (DalUtil.getId(trl.getLanguage()).equals(userLanguageId)) { return trl.getName(); } }
-     */
+    final String userLanguageId = OBContext.getOBContext().getLanguage().getId();
+    for (QueryColumnTrl trl : column.getOBCQLQueryColumnTrlList()) {
+      if (DalUtil.getId(trl.getLanguage()).equals(userLanguageId)) {
+        return trl.getName();
+      }
+    }
+
     return column.getName();
   }
 }
--- a/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Wed Dec 15 19:09:45 2010 +0100
+++ b/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Wed Dec 15 19:12:05 2010 +0100
@@ -55,21 +55,29 @@
         'eventType': 'GET_FIELDS',
         'viewMode': this.viewMode
       };
+    var clientContext = {widget: this};
 
     OB.RemoteCallManager.call(this.actionHandler, post, {}, function(rpcResponse, data, rpcRequest){
-      if (data && data.ID && window[data.ID]) {
-        window[data.ID].reloadGrid(rpcResponse, data, rpcRequest);
-      }
-    });
+      rpcResponse.clientContext.widget.reloadGrid(rpcResponse, data, rpcRequest);
+    }, clientContext);
   },
 
   reloadGrid: function(rpcResponse, data, rpcRequest) {
 
     this.fields = data.fields;
     this.grid.setDataSource(this.grid.dataSource);
-    this.grid.setFields();
     this.grid.invalidateCache();
     this.grid.filterData();
+//    this.grid.destroy();
+//    this.grid = isc.OBQueryListGrid.create(isc.addProperties({
+//      widget: this,
+//      fields: this.fields
+//    }, this.gridProperties));
+    this.markForRedraw();
+  },
+
+  exportGrid: function() {
+    this.grid.exportData();
   }
   
 });
@@ -135,5 +143,22 @@
     criteria.rowsNumber = this.widget.rowsNumber;
     criteria.viewMode = this.widget.viewMode;
     return this.Super('fetchData', [criteria, callback, requestProperties]);
-  }  
+  },
+
+  cellClick: function (record, rowNum, colNum) {
+    var field = this.getField(colNum);
+    if (field.OB_HasLink) {
+      if (field.OB_TabId && field.OB_LinkExpression) {
+        OB.Layout.ViewManager.openView('OBClassicWindow',  {
+            tabId: field.OB_TabId,
+            recordId: record[field.OB_LinkExpression],
+            windowId: field.OB_WindowId,
+            command: 'DIRECT',
+            tabTitle: field.OB_WindowTitle,
+            mappingName: field.OB_mappingName,
+            keyParameter: field.OB_keyParameter
+        });
+      }
+    }
+  }
 });