Currently using smartgwtee-3.0p-NB-20120516 on RHEL 5.x. I am having problems with the multiple select item on a listgrid. My multiple select item has a datasource. When I select an item from the selectitem, i get no records back. The sql query generated by smartclient puts 2 extra '' around the item i selected. Here is what I grab from the console:
Here is the code that I write to set the select items
Code:
criteria:{ operator:"and", _constructor:"AdvancedCriteria", criteria:[ { fieldName:"PTNAME", operator:"inSet", value:[ "Water", "Height" ] }, { fieldName:"START_TIMESTAMP", operator:"greaterOrEqual", value:new Date(1333324800000) } ] }, operationConfig:{ dataSource:"MyDataSource", operationType:"fetch", textMatchStyle:"substring" }, startRow:0, endRow:75, componentId:"isc_mytable_0_Table", appID:"builtinApplication", operation:"MyDataSource_fetch", oldValues:{ operator:"and", _constructor:"AdvancedCriteria", criteria:[ { fieldName:"PTNAME", operator:"inSet", value:[ "Water", "Height" ] }, { fieldName:"START_TIMESTAMP", operator:"greaterOrEqual", value:new Date(1333324800000) } ] } } === 2012-06-13 15:07:13,136 [l0-8] INFO IDACall - Performing 1 operation(s) === 2012-06-13 15:07:13,136 [l0-8] DEBUG AppBase - [builtinApplication.MyDataSource_fetch] No userTypes defined, allowing anyone access to all operations for this application === 2012-06-13 15:07:13,136 [l0-8] DEBUG AppBase - [builtinApplication.MyDataSource_fetch] No public zero-argument method named '_MyDataSource_fetch' found, performing generic datasource operation === 2012-06-13 15:07:13,137 [l0-8] INFO SQLDataSource - [builtinApplication.MyDataSource_fetch] Performing fetch operation with criteria: {criteria:[{fieldName:"PTNAME",operator:"inSet",value:["'Water'","'Height'"]},{fieldName:"START_TIMESTAMP",operator:"greaterOrEqual",value:new Date(1333324800000)}],operator:"and",_constructor:"AdvancedCriteria"} values: {criteria:[{fieldName:"PTNAME",operator:"inSet",value:["'Water'","'Height'"]},{fieldName:"START_TIMESTAMP",operator:"greaterOrEqual",value:new Date(1333324800000)}],operator:"and",_constructor:"AdvancedCriteria"} === 2012-06-13 15:07:13,137 [l0-8] INFO SQLDataSource - [builtinApplication.MyDataSource_fetch] derived query: SELECT $defaultSelectClause FROM P, PAT, PA, PT WHERE P.P_ID = PA.P_ID AND PA.PAT_ID = PAT.PAT_ID AND PT.PT_ID = P.PT_ID AND (PA.VALUE > PAT.MAX_THRESHOLD OR PA.VALUE < PAT.MIN_THRESHOLD) AND ($defaultWhereClause) ORDER BY START_TIMESTAMP ASC === 2012-06-13 15:07:13,138 [l0-8] DEBUG SQLDataSource - [builtinApplication.MyDataSource_fetch] Executing row count query: SELECT COUNT(*) FROM P, PAT, PA, PT WHERE P.P_ID = PA.P_ID AND PA.PAT_ID = PAT.PAT_ID AND PT.PT_ID = P.PT_ID AND (PA.VALUE > PAT.MAX_THRESHOLD OR PA.VALUE < PAT.MIN_THRESHOLD) AND ($defaultWhereClause) === 2012-06-13 15:07:13,138 [l0-8] DEBUG SQLDataSource - [builtinApplication.MyDataSource_fetch] Eval'd row count query: SELECT COUNT(*) FROM P, PAT, PA, PT WHERE P.P_ID = PA.P_ID AND PA.PAT_ID = PAT.PAT_ID AND PT.PT_ID = P.PT_ID AND (PA.VALUE > PAT.MAX_THRESHOLD OR PA.VALUE < PAT.MIN_THRESHOLD) AND ((((PT.Name IN ('''Water''', '''Height''')) AND PT.Name IS NOT NULL) AND (P.START_TIMESTAMP >= TO_DATE('2012-04-02 00:00:00','YYYY-MM-DD HH24:MI:SS') AND P.START_TIMESTAMP IS NOT NULL))) === 2012-06-13 15:07:13,163 [l0-8] DEBUG PoolableSQLConnectionFactory - [builtinApplication.MyDataSource_fetch] Returning pooled Connection === 2012-06-13 15:07:13,164 [l0-8] INFO SQLDriver - [builtinApplication.MyDataSource_fetch] Executing SQL query on 'Oracle': SELECT COUNT(*) FROM P, PAT, PA, PT WHERE P.P_ID = PA.P_ID AND PA.PAT_ID = PAT.PAT_ID AND PT.PT_ID = P.PT_ID AND (PA.VALUE > PAT.MAX_THRESHOLD OR PA.VALUE < PAT.MIN_THRESHOLD) AND ((((PT.Name IN ('''Water''', '''Height''')) AND PT.Name IS NOT NULL) AND (P.START_TIMESTAMP >= TO_DATE('2012-04-02 00:00:00','YYYY-MM-DD HH24:MI:SS') AND P.START_TIMESTAMP IS NOT NULL))) === 2012-06-13 15:07:13,325 [0-10] INFO Download - Returning 304: Not modified on conditional get of: /sc/skins/Enterprise/images/loadingSmall.gif === 2012-06-13 15:07:13,618 [l0-8] INFO DSResponse - [builtinApplication.MyDataSource_fetch] DSResponse: List with 0 items
Code:
ListGridField gridField = theListGrid.getField(aFieldName); gridField.setOptionDataSource(DataSource.get(aDataSourceName)); gridField.setAutoFetchDisplayMap(true); // Create the select item that will be used by the list grid field. SelectItem selectItem = new SelectItem(); // allow multiple parameters to be selected for the same field selectItem.setMultiple(true); selectItem.setAllowEmptyValue(true); gridField.setFilterEditorProperties(selectItem);
Comment