Hi Isomorphic,
please see this modified buildInDs-sample form today's nightly (v9.1p_2014-07-08):
BuiltInDS.java:
animals.ds.xml:
I also changed some animal's lifeSpan in animals.data.xml in order to get Join-matches to the employees.EmployeeId (for some reason I can't see any data in the ListGrid, even though the join is correct and matching data is there, but that is not what this is about).
With this configuration I'd expect employees.Name data (strings) in the 3rd column and that is what's happening in my application (Oracle based).
If you now try to filter on the 3rd column and e.g. enter "Iso" in the field and hit enter, I get the following request / log data:
RPC-Tab of Developer Console window:
Server log:
Besides this, the filter field is also displaying "loading..." for a short amount of time.
I'd expect to
Could you please tell me if this is a bug (possible in my opinion) or a misuse (or missing use) of the APIs?
I'd like to achieve that the search is a text-only search to the display field. No lookup-request should be issued from the filterField. The filtering in the ListGrid should be ICONTAINS for this field.
Thank you & Best regards,
Blama
please see this modified buildInDs-sample form today's nightly (v9.1p_2014-07-08):
BuiltInDS.java:
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; public class BuiltInDS implements EntryPoint { private ListGrid boundList; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); DataSource ds = DataSource.get("animals"); boundList = new ListGrid(); boundList.setDataSource(ds); boundList.setHeight(500); boundList.setWidth(500); boundList.setShowFilterEditor(true); boundList.setAutoFetchData(false); ListGridField scientificName = new ListGridField("scientificName"); ListGridField commonName = new ListGridField("commonName"); ListGridField lifeSpan = new ListGridField("lifeSpan") { { setSortByDisplayField(true); setFilterEditorProperties(new TextItem()); setFilterOperator(OperatorId.ICONTAINS); } }; boundList.setFields(scientificName, commonName, lifeSpan); boundList.draw(); boundList.fetchData(); } }
Code:
<DataSource ID="animals" serverType="sql" tableName="animals" testFileName="animals.data.xml"> <fields> <field name="commonName" title="Animal" type="text" /> <field name="scientificName" title="Scientific Name" type="text" primaryKey="true" required="true" /> [B] <field name="lifeSpan" foreignKey="employees.EmployeeId" title="Life Span" type="integer" displayField="testfield" /> <field name="testfield" includeFrom="employees.Name" hidden="true" /> [/B] <field name="status" title="Endangered Status" type="text"> <valueMap> <value>Threatened</value> <value>Endangered</value> <value>Not Endangered</value> <value>Not currently listed</value> <value>May become threatened</value> <value>Protected</value> </valueMap> </field> <field name="diet" title="Diet" type="text" /> <field name="information" title="Interesting Facts" type="text" length="1000" /> <field name="picture" title="Picture" type="image" detail="true" imageURLPrefix="/isomorphic/system/reference/inlineExamples/tiles/images/" /> </fields> </DataSource>
With this configuration I'd expect employees.Name data (strings) in the 3rd column and that is what's happening in my application (Oracle based).
If you now try to filter on the 3rd column and e.g. enter "Iso" in the field and hit enter, I get the following request / log data:
RPC-Tab of Developer Console window:
Code:
{ dataSource:"employees", operationType:"fetch", componentId:"isc_ListGrid_0filterEditor_body", data:{ EmployeeId:"Iso" }, textMatchStyle:"exact", callback:{ target:[TextItem ID:isc_TextItem_3 name:lifeSpan], methodName:"fetchMissingValueReply" }, showPrompt:false, oldValues:{ EmployeeId:"Iso" }, requestId:"employees$6271", internalClientContext:{ dataValue:"Iso", filterLocally:{ } }, fallbackToEval:false, componentContext:"lifeSpan", lastClientEventThreadCode:"IFCS2", bypassCache:true }
Code:
=== 2014-07-09 21:10:36,053 [4-33] INFO Download - Returning 304: Not modified on conditional get of: C:\Users\salekt\workspace\lib\smartgwtee-4.1p\samples\built-in-ds\war\builtinds\sc\skins\Enterprise\images\ListGrid\sort_descending.png === 2014-07-09 21:10:38,866 [4-46] INFO RequestContext - URL: '/builtinds/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0': Moz (Gecko) with Accept-Encoding header === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Cookie:isc_cState=ready; JSESSIONID=d5zeh4h5wlfj5mv7qur11xop; GLog=%7B%0D%20%20%20%20left%3A1161%2C%20%0D%20%20%20%20top%3A0%2C%20%0D%20%20%20%20width%3A638%2C%20%0D%20%20%20%20height%3A479%2C%20%0D%20%20%20%20priorityDefaults%3A%7B%0D%20%20%20%20%20%20%20%20Log%3A4%0D%20%20%20%20%7D%2C%20%0D%20%20%20%20defaultPriority%3A3%2C%20%0D%20%20%20%20trackRPC%3Atrue%0D%7D === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: DNT:1 === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Host:127.0.0.1:8888 === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Content-Length:978 === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Content-Type:application/x-www-form-urlencoded; charset=UTF-8 === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Accept-Language:de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Pragma:no-cache === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Connection:keep-alive === 2014-07-09 21:10:38,867 [4-46] DEBUG IDACall - Header Name:Value pair: Referer:http://127.0.0.1:8888/BuiltInDS.html?gwt.codesvr=127.0.0.1:9997 === 2014-07-09 21:10:38,868 [4-46] DEBUG IDACall - Header Name:Value pair: User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0 === 2014-07-09 21:10:38,868 [4-46] DEBUG IDACall - Header Name:Value pair: Cache-Control:no-cache === 2014-07-09 21:10:38,868 [4-46] DEBUG IDACall - Header Name:Value pair: Accept-Encoding:gzip, deflate === 2014-07-09 21:10:38,868 [4-46] DEBUG IDACall - session exists: d5zeh4h5wlfj5mv7qur11xop === 2014-07-09 21:10:38,868 [4-46] DEBUG IDACall - remote user: null === 2014-07-09 21:10:38,880 [4-46] DEBUG XML - Parsed XML from (in memory stream): 7ms === 2014-07-09 21:10:38,880 [4-46] DEBUG ISCKeyedObjectPool - Borrowing object for 'transaction' === 2014-07-09 21:10:38,881 [4-46] DEBUG ISCKeyedObjectPool - Borrowing object for 'Object' === 2014-07-09 21:10:38,882 [4-46] DEBUG ISCKeyedObjectPool - Borrowing object for 'List' === 2014-07-09 21:10:38,883 [4-46] DEBUG ISCKeyedObjectPool - Borrowing object for 'elem' === 2014-07-09 21:10:38,884 [4-46] DEBUG RPCManager - Processing 1 requests. === 2014-07-09 21:10:38,884 [4-46] DEBUG ISCKeyedObjectPool - Borrowing object for 'employees' === 2014-07-09 21:10:38,885 [4-46] DEBUG DSRequest - Caching instance 19 of DS employees from DSRequest.getDataSource() === 2014-07-09 21:10:38,886 [4-46] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ EmployeeId:"Iso" }, operationConfig:{ dataSource:"employees", operationType:"fetch", textMatchStyle:"exact" }, componentId:"isc_ListGrid_0filterEditor_body", appID:"builtinApplication", operation:"employees_fetch", oldValues:{ EmployeeId:"Iso" } } === 2014-07-09 21:10:38,886 [4-46] INFO IDACall - Performing 1 operation(s) === 2014-07-09 21:10:38,886 [4-46] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null === 2014-07-09 21:10:38,887 [4-46] DEBUG DeclarativeSecurity - DataSource employees is not in the pre-checked list, processing... === 2014-07-09 21:10:38,887 [4-46] DEBUG AppBase - [builtinApplication.employees_fetch] No userTypes defined, allowing anyone access to all operations for this application === 2014-07-09 21:10:38,888 [4-46] DEBUG AppBase - [builtinApplication.employees_fetch] No public zero-argument method named '_employees_fetch' found, performing generic datasource operation === 2014-07-09 21:10:38,889 [4-46] INFO SQLDataSource - [builtinApplication.employees_fetch] Performing fetch operation with criteria: {EmployeeId:"Iso"} values: {EmployeeId:"Iso"} === 2014-07-09 21:10:38,892 [4-46] WARN SQLWhereClause - [builtinApplication.employees_fetch] Got non-numeric value 'Iso' for numeric column 'EmployeeId', creating literal false expression: java.lang.NumberFormatException: For input string: "Iso" === 2014-07-09 21:10:38,893 [4-46] INFO SQLDataSource - [builtinApplication.employees_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause === 2014-07-09 21:10:38,894 [4-46] INFO SQLDataSource - [builtinApplication.employees_fetch] 19: Executing SQL query on 'HSQLDB': SELECT employeeTable.Email, employeeTable.EmployeeId, employeeTable.EmployeeStatus, employeeTable.EmployeeType, employeeTable.Gender, employeeTable.Job, employeeTable.MaritalStatus, employeeTable.Name, employeeTable.OrgUnit, employeeTable.ReportsTo, employeeTable.Salary, employeeTable.userOrder FROM employeeTable WHERE ('0'='1') === 2014-07-09 21:10:38,895 [4-46] DEBUG PoolableSQLConnectionFactory - [builtinApplication.employees_fetch] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:hsql://localhost/isomorphic === 2014-07-09 21:10:38,896 [4-46] DEBUG PoolableSQLConnectionFactory - [builtinApplication.employees_fetch] Passing JDBC URL only to getConnection === 2014-07-09 21:10:38,898 [4-47] INFO RequestContext - URL: '/builtinds/sc/skins/Enterprise/images/DynamicForm/checkbox_sprite.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0': Moz (Gecko) with Accept-Encoding header === 2014-07-09 21:10:38,898 [4-33] INFO RequestContext - URL: '/builtinds/sc/system/reference/skin/images/server_client_exchange.png', User-Agent: 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0': Moz (Gecko) with Accept-Encoding header === 2014-07-09 21:10:38,900 [4-47] INFO Download - done streaming: C:/Users/salekt/workspace/lib/smartgwtee-4.1p/samples/built-in-ds/war/builtinds/sc/skins/Enterprise/images/DynamicForm/checkbox_sprite.png === 2014-07-09 21:10:38,903 [4-33] INFO Download - done streaming: C:/Users/salekt/workspace/lib/smartgwtee-4.1p/samples/built-in-ds/war/builtinds/sc/system/reference/skin/images/server_client_exchange.png === 2014-07-09 21:10:38,999 [4-46] DEBUG PoolableSQLConnectionFactory - [builtinApplication.employees_fetch] makeObject() created an unpooled Connection '762161803' === 2014-07-09 21:10:38,999 [4-46] DEBUG SQLConnectionManager - [builtinApplication.employees_fetch] Borrowed connection '762161803' === 2014-07-09 21:10:38,999 [4-46] DEBUG SQLDriver - [builtinApplication.employees_fetch] About to execute SQL query in 'HSQLDB' using connection '762161803' === 2014-07-09 21:10:38,999 [4-46] INFO SQLDriver - [builtinApplication.employees_fetch] Executing SQL query on 'HSQLDB': SELECT employeeTable.Email, employeeTable.EmployeeId, employeeTable.EmployeeStatus, employeeTable.EmployeeType, employeeTable.Gender, employeeTable.Job, employeeTable.MaritalStatus, employeeTable.Name, employeeTable.OrgUnit, employeeTable.ReportsTo, employeeTable.Salary, employeeTable.userOrder FROM employeeTable WHERE ('0'='1') === 2014-07-09 21:10:39,003 [4-46] INFO DSResponse - [builtinApplication.employees_fetch] DSResponse: List with 0 items === 2014-07-09 21:10:39,004 [4-46] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8 === 2014-07-09 21:10:39,004 [4-46] DEBUG RPCManager - non-DMI response, dropExtraFields: false === 2014-07-09 21:10:39,006 [4-46] DEBUG SQLDriver - Freeing SQLDriver dbConnection 762161803 === 2014-07-09 21:10:39,006 [4-46] DEBUG SQLConnectionManager - About to close JDBCConnection with hashcode "762161803" === 2014-07-09 21:10:39,007 [4-46] INFO Compression - /builtinds/sc/IDACall: 188 -> 152 bytes
I'd expect to
- Get no request to employees at all (and no "loading...")
- If there has to be a request, it should go to employees.Name (because that is the includeFrom-source from the displayField) and therefore the framework should expect a string (see "Got non-numeric value 'Iso' for numeric column 'EmployeeId', creating literal false expression" in the log)
Could you please tell me if this is a bug (possible in my opinion) or a misuse (or missing use) of the APIs?
I'd like to achieve that the search is a text-only search to the display field. No lookup-request should be issued from the filterField. The filtering in the ListGrid should be ICONTAINS for this field.
Thank you & Best regards,
Blama
Comment