Fixes issue 22734: New functionality: widgets with user-defined datasource
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 08 Jan 2013 11:39:12 +0100
changeset 19167 9ad8f68a0a90
parent 19166 a47cc1fa013d
child 19168 ea6ae5a9d6e2
Fixes issue 22734: New functionality: widgets with user-defined datasource

Summary of the changes:
- modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_COLUMN.xml: The HQL column has been changed in the application dictionary so it is no longer mandatory
- modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REFERENCE.xml: New list reference that holds the possible query widget types
- modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REF_LIST.xml: List items of the new reference ('DS' and 'HQL').
- modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_WIDGET_QUERY.xml: Database changes in the OBCQL_WIDGET_QUERY table:
* The HQL column is no longer mandatory
* Added two new columns: Type and Datasource
- modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml: Definition of the new columns in the Column table of the application dictio
nary
- modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml: Definition of the new columns in the Field table of the application dictiona
ry, plus a change in the display logic of the HQL field so that it is only shown when the proper option is selected in the Type field.
- modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListWidgetProvider.java: Logic that uses the user-defined datasource when fet
ching the data of a widget that is associated with a user-defined datasource.
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_COLUMN.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REFERENCE.xml
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REF_LIST.xml
modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_WIDGET_QUERY.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/QueryListWidgetProvider.java
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jan 08 06:08:14 2013 +0100
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jan 08 11:39:12 2013 +0100
@@ -2880,7 +2880,7 @@
 <!--927DA01A83573AFAE040A8C0CF072B85-->  <FIELDLENGTH><![CDATA[4000]]></FIELDLENGTH>
 <!--927DA01A83573AFAE040A8C0CF072B85-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--927DA01A83573AFAE040A8C0CF072B85-->  <ISPARENT><![CDATA[N]]></ISPARENT>
-<!--927DA01A83573AFAE040A8C0CF072B85-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--927DA01A83573AFAE040A8C0CF072B85-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
 <!--927DA01A83573AFAE040A8C0CF072B85-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
 <!--927DA01A83573AFAE040A8C0CF072B85-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--927DA01A83573AFAE040A8C0CF072B85-->  <SEQNO><![CDATA[100]]></SEQNO>
--- a/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Jan 08 06:08:14 2013 +0100
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Jan 08 11:39:12 2013 +0100
@@ -49,6 +49,18 @@
 <!--B0BA46A241B543CF80B4046F080FA9DE-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--B0BA46A241B543CF80B4046F080FA9DE--></AD_REFERENCE>
 
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5--><AD_REFERENCE>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <AD_REFERENCE_ID><![CDATA[CB6C648A6CAB4F749CB25EB1EBC4BAB5]]></AD_REFERENCE_ID>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <NAME><![CDATA[List Widget Type]]></NAME>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--CB6C648A6CAB4F749CB25EB1EBC4BAB5--></AD_REFERENCE>
+
 <!--FF8080813123BF670131241C2BB30012--><AD_REFERENCE>
 <!--FF8080813123BF670131241C2BB30012-->  <AD_REFERENCE_ID><![CDATA[FF8080813123BF670131241C2BB30012]]></AD_REFERENCE_ID>
 <!--FF8080813123BF670131241C2BB30012-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Jan 08 11:39:12 2013 +0100
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<data>
+<!--8D27EB2B300D4E8987190E1ECCF84742--><AD_REF_LIST>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <AD_REF_LIST_ID><![CDATA[8D27EB2B300D4E8987190E1ECCF84742]]></AD_REF_LIST_ID>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <VALUE><![CDATA[DS]]></VALUE>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <NAME><![CDATA[Datasource]]></NAME>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <AD_REFERENCE_ID><![CDATA[CB6C648A6CAB4F749CB25EB1EBC4BAB5]]></AD_REFERENCE_ID>
+<!--8D27EB2B300D4E8987190E1ECCF84742-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--8D27EB2B300D4E8987190E1ECCF84742--></AD_REF_LIST>
+
+<!--AFC52045618140D49359B58E638F3552--><AD_REF_LIST>
+<!--AFC52045618140D49359B58E638F3552-->  <AD_REF_LIST_ID><![CDATA[AFC52045618140D49359B58E638F3552]]></AD_REF_LIST_ID>
+<!--AFC52045618140D49359B58E638F3552-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AFC52045618140D49359B58E638F3552-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AFC52045618140D49359B58E638F3552-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AFC52045618140D49359B58E638F3552-->  <VALUE><![CDATA[HQL]]></VALUE>
+<!--AFC52045618140D49359B58E638F3552-->  <NAME><![CDATA[HQL]]></NAME>
+<!--AFC52045618140D49359B58E638F3552-->  <AD_REFERENCE_ID><![CDATA[CB6C648A6CAB4F749CB25EB1EBC4BAB5]]></AD_REFERENCE_ID>
+<!--AFC52045618140D49359B58E638F3552-->  <AD_MODULE_ID><![CDATA[2758CD25B2704AF6BBAD10365FC82C06]]></AD_MODULE_ID>
+<!--AFC52045618140D49359B58E638F3552--></AD_REF_LIST>
+
+</data>
--- a/modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_WIDGET_QUERY.xml	Tue Jan 08 06:08:14 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/model/tables/OBCQL_WIDGET_QUERY.xml	Tue Jan 08 11:39:12 2013 +0100
@@ -37,7 +37,15 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="HQL" primaryKey="false" required="true" type="VARCHAR" size="4000" autoIncrement="false">
+      <column name="HQL" primaryKey="false" required="false" type="VARCHAR" size="4000" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="TYPE" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default><![CDATA[HQL]]></default>
+        <onCreateDefault><![CDATA['HQL']]></onCreateDefault>
+      </column>
+      <column name="OBSERDS_DATASOURCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
       </column>
@@ -47,9 +55,15 @@
       <foreign-key foreignTable="AD_CLIENT" name="OBCQL_WIDGET_QUERY_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
+      <foreign-key foreignTable="OBSERDS_DATASOURCE" name="OBCQL_WIDGET_QUERY_DS">
+        <reference local="OBSERDS_DATASOURCE_ID" foreign="OBSERDS_DATASOURCE_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="AD_ORG" name="OBCQL_WIDGET_QUERY_ORG">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
+      <index name="FKI_OBCQL_WIDGET_QUERY_DS" unique="false">
+        <index-column name="OBSERDS_DATASOURCE_ID"/>
+      </index>
       <check name="OBCQL_WIDGET_QUERY_ACTIVECHK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jan 08 06:08:14 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jan 08 11:39:12 2013 +0100
@@ -1,5 +1,39 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--81001DA1F1D44C10979E937B1754307F--><AD_COLUMN>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_COLUMN_ID><![CDATA[81001DA1F1D44C10979E937B1754307F]]></AD_COLUMN_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--81001DA1F1D44C10979E937B1754307F-->  <NAME><![CDATA[Type]]></NAME>
+<!--81001DA1F1D44C10979E937B1754307F-->  <COLUMNNAME><![CDATA[Type]]></COLUMNNAME>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_TABLE_ID><![CDATA[87AB97C7EED3429BBEFE9EF28EFACC08]]></AD_TABLE_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_REFERENCE_VALUE_ID><![CDATA[CB6C648A6CAB4F749CB25EB1EBC4BAB5]]></AD_REFERENCE_VALUE_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--81001DA1F1D44C10979E937B1754307F-->  <DEFAULTVALUE><![CDATA[HQL]]></DEFAULTVALUE>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--81001DA1F1D44C10979E937B1754307F-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--81001DA1F1D44C10979E937B1754307F-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--81001DA1F1D44C10979E937B1754307F-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--81001DA1F1D44C10979E937B1754307F-->  <POSITION><![CDATA[11]]></POSITION>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--81001DA1F1D44C10979E937B1754307F-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--81001DA1F1D44C10979E937B1754307F-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--81001DA1F1D44C10979E937B1754307F-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--81001DA1F1D44C10979E937B1754307F--></AD_COLUMN>
+
 <!--95CC5757ECB2E5B8E040007F010076A5--><AD_COLUMN>
 <!--95CC5757ECB2E5B8E040007F010076A5-->  <AD_COLUMN_ID><![CDATA[95CC5757ECB2E5B8E040007F010076A5]]></AD_COLUMN_ID>
 <!--95CC5757ECB2E5B8E040007F010076A5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1567,4 +1601,36 @@
 <!--998FF6ADFBCC705DE040007F01006349-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--998FF6ADFBCC705DE040007F01006349--></AD_COLUMN>
 
+<!--A679FE2F67C0486CBFB774E72A76618B--><AD_COLUMN>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <AD_COLUMN_ID><![CDATA[A679FE2F67C0486CBFB774E72A76618B]]></AD_COLUMN_ID>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <NAME><![CDATA[Obserds_Datasource_ID]]></NAME>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <COLUMNNAME><![CDATA[Obserds_Datasource_ID]]></COLUMNNAME>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <AD_TABLE_ID><![CDATA[87AB97C7EED3429BBEFE9EF28EFACC08]]></AD_TABLE_ID>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <POSITION><![CDATA[12]]></POSITION>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--A679FE2F67C0486CBFB774E72A76618B-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--A679FE2F67C0486CBFB774E72A76618B--></AD_COLUMN>
+
 </data>
--- a/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml	Tue Jan 08 06:08:14 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_FIELD.xml	Tue Jan 08 11:39:12 2013 +0100
@@ -1,5 +1,60 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--82D5C58E310948088A4FE87611B1D84A--><AD_FIELD>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <AD_FIELD_ID><![CDATA[82D5C58E310948088A4FE87611B1D84A]]></AD_FIELD_ID>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <NAME><![CDATA[Type]]></NAME>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <AD_TAB_ID><![CDATA[8BA14DE095DE496A82A84FE53F0B9821]]></AD_TAB_ID>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <AD_COLUMN_ID><![CDATA[81001DA1F1D44C10979E937B1754307F]]></AD_COLUMN_ID>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--82D5C58E310948088A4FE87611B1D84A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--82D5C58E310948088A4FE87611B1D84A--></AD_FIELD>
+
+<!--90A30A5448AB4813BECCD8804DFF8592--><AD_FIELD>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_FIELD_ID><![CDATA[90A30A5448AB4813BECCD8804DFF8592]]></AD_FIELD_ID>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <NAME><![CDATA[Datasource]]></NAME>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_TAB_ID><![CDATA[8BA14DE095DE496A82A84FE53F0B9821]]></AD_TAB_ID>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_COLUMN_ID><![CDATA[A679FE2F67C0486CBFB774E72A76618B]]></AD_COLUMN_ID>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <DISPLAYLOGIC><![CDATA[@Type@='DS']]></DISPLAYLOGIC>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <AD_MODULE_ID><![CDATA[0A060B2AF1974E8EAA8DB61388E9AECC]]></AD_MODULE_ID>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <GRID_SEQNO><![CDATA[0]]></GRID_SEQNO>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--90A30A5448AB4813BECCD8804DFF8592-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--90A30A5448AB4813BECCD8804DFF8592--></AD_FIELD>
+
 <!--95CC803CC7499A85E040007F010076A9--><AD_FIELD>
 <!--95CC803CC7499A85E040007F010076A9-->  <AD_FIELD_ID><![CDATA[95CC803CC7499A85E040007F010076A9]]></AD_FIELD_ID>
 <!--95CC803CC7499A85E040007F010076A9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -66,6 +121,7 @@
 <!--95CC803CC74D9A85E040007F010076A9-->  <AD_COLUMN_ID><![CDATA[95CC5757ECBBE5B8E040007F010076A5]]></AD_COLUMN_ID>
 <!--95CC803CC74D9A85E040007F010076A9-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
 <!--95CC803CC74D9A85E040007F010076A9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--95CC803CC74D9A85E040007F010076A9-->  <DISPLAYLOGIC><![CDATA[@Type@='HQL']]></DISPLAYLOGIC>
 <!--95CC803CC74D9A85E040007F010076A9-->  <DISPLAYLENGTH><![CDATA[4000]]></DISPLAYLENGTH>
 <!--95CC803CC74D9A85E040007F010076A9-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
 <!--95CC803CC74D9A85E040007F010076A9-->  <SEQNO><![CDATA[20]]></SEQNO>
@@ -99,7 +155,7 @@
 <!--95CC803CC74F9A85E040007F010076A9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--95CC803CC74F9A85E040007F010076A9-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--95CC803CC74F9A85E040007F010076A9-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
-<!--95CC803CC74F9A85E040007F010076A9-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--95CC803CC74F9A85E040007F010076A9-->  <SEQNO><![CDATA[40]]></SEQNO>
 <!--95CC803CC74F9A85E040007F010076A9-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--95CC803CC74F9A85E040007F010076A9-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--95CC803CC74F9A85E040007F010076A9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListWidgetProvider.java	Tue Jan 08 06:08:14 2013 +0100
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListWidgetProvider.java	Tue Jan 08 11:39:12 2013 +0100
@@ -30,6 +30,7 @@
 import org.openbravo.client.kernel.Component;
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.client.kernel.KernelConstants;
+import org.openbravo.client.myob.WidgetClass;
 import org.openbravo.client.myob.WidgetInstance;
 import org.openbravo.client.myob.WidgetProvider;
 import org.openbravo.service.datasource.DataSourceComponentProvider;
@@ -93,8 +94,19 @@
     final Map<String, Object> localParameters = new HashMap<String, Object>();
     localParameters.putAll(getParameters());
     localParameters.put(DataSourceConstants.DS_ONLY_GENERATE_CREATESTATEMENT, true);
-    localParameters.put(WIDGETCLASS_PARAMETER, getWidgetClass());
-    final Component dsComponent = dataSourceComponentProvider.getComponent(DATASOURCEID,
+
+    WidgetClass widget = getWidgetClass();
+    OBCQL_WidgetQuery listWidget = widget.getOBCQLWidgetQueryList().get(0);
+    String listWidgetType = listWidget.getType();
+    String datasourceId = null;
+    if ("HQL".equals(listWidgetType)) {
+      datasourceId = DATASOURCEID;
+    } else {
+      datasourceId = listWidget.getObserdsDatasource().getId();
+    }
+
+    localParameters.put(WIDGETCLASS_PARAMETER, widget);
+    final Component dsComponent = dataSourceComponentProvider.getComponent(datasourceId,
         localParameters);
     final String dsJavaScript = dsComponent.generate();
     return dsJavaScript;