Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid filtering issue

    SmartGwt 3.0p 2/16 nightly
    Gwt 2.4
    Firefox 6.0

    I have the following code ...

    Code:
    		ListGrid addressBook = new ListGrid();
    		addressBook.setDataSource(employeesDS);
    		addressBook.setAutoFetchData(true);
    		addressBook.setCriteria(new Criteria("Sex", "M"));
    		addressBook.setShowFilterEditor(true);
    		addressBook.setFilterOnKeypress(true);
    Below is my ds.xml file...
    Code:
    <field name="EmployeeId" type="sequence" primaryKey="true" hidden="true" />
    		<field name="FirstName" title="First Name" type="text" length="64" required="true" />
    		<field name="LastName" title="Last Name" type="text" length="64" required="true" />
    		<field name="Sex" title="Sex" type="text" length="1" />
    		<field name="Position" title="Position" type="text" length="64" />
    		<field name="DateOfBirth" title="Date Of Birth (MM/DD/YYYY)" type="date" />
    The ListGrid code snippet shown above allows listens to my criteria sent and also allows me to filter through my data as needed throughout all of my fields.

    However, if I were to change the code from a "Criteria" to a "Criterion"... as shown below.....

    Code:
    		ListGrid addressBook = new ListGrid();
    		addressBook.setDataSource(employeesDS);
    		addressBook.setAutoFetchData(true);
    		addressBook.setCriteria(new Criterion("Sex", OperatorId.EQUALS, "M"));
    		addressBook.setShowFilterEditor(true);
    		addressBook.setFilterOnKeypress(true);
    The ListGrid returns the correct set of Data, however I am not able to use any filter on any field to filter through my data.
    Why is this?

    #2
    I just downloaded the current nightly (3/13/2012), tried the same example, and achieved the same results..

    Firebug log...

    Code:
    	<transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">0</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"><fieldName>Sex</fieldName><operator>equals</operator><value>M</value></criteria><operationConfig xsi:type="xsd:Object"><dataSource>Employees</dataSource><operationType>fetch</operationType><textMatchStyle>substring</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">75</endRow><componentId>isc_ListGrid_0</componentId><appID>builtinApplication</appID><operation>Employees_fetch</operation><oldValues xsi:type="xsd:Object"><fieldName>Sex</fieldName><operator>equals</operator><value>M</value></oldValues></elem></operations></transaction>
    
    
    Response Headers
    Cache-Control	no-cache
    Content-Encoding	gzip
    Content-Length	4034
    Content-Type	text/plain; charset=utf-8
    Expires	Tue, 13 Mar 2012 22:36:49 GMT
    Pragma	no-cache
    Server	Jetty(6.1.x)
    X-Included-Test	true
    X-Included-Test2	true
    Request Headers
    Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding	gzip, deflate
    Accept-Language	en-us,en;q=0.5
    Connection	keep-alive
    Content-Length	1201
    Content-Type	application/x-www-form-urlencoded; charset=UTF-8
    Cookie	isc_cState=ready; JSESSIONID=1w8f572rx0i2l
    Host	127.0.0.1:2148
    Referer	http://127.0.0.1:2148/index.html?gwt.codesvr=127.0.0.1:9997
    User-Agent	Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0
    Eclipse Console...
    Code:
    === 2012-03-13 18:36:45,155 [l0-3] INFO  RequestContext - URL: '/testbed/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0': Moz (Gecko) with Accept-Encoding header
    === 2012-03-13 18:36:45,661 [l0-3] DEBUG XML - Parsed XML from (in memory stream): 504ms
    === 2012-03-13 18:36:45,978 [l0-3] DEBUG RPCManager - Processing 1 requests.
    === 2012-03-13 18:36:45,983 [l0-3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            fieldName:"Sex",
            operator:"equals",
            value:"M"
        },
        operationConfig:{
            dataSource:"Employees",
            operationType:"fetch",
            textMatchStyle:"substring"
        },
        startRow:0,
        endRow:75,
        componentId:"isc_ListGrid_0",
        appID:"builtinApplication",
        operation:"Employees_fetch",
        oldValues:{
            fieldName:"Sex",
            operator:"equals",
            value:"M"
        }
    }
    === 2012-03-13 18:36:45,984 [l0-3] DEBUG AppBase - [builtinApplication.Employees_fetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2012-03-13 18:36:45,985 [l0-3] DEBUG AppBase - [builtinApplication.Employees_fetch] No public zero-argument method named '_Employees_fetch' found, performing generic datasource operation
    === 2012-03-13 18:36:46,142 [l0-3] INFO  SQLDataSource - [builtinApplication.Employees_fetch] Performing fetch operation with
    	criteria: {fieldName:"Sex",operator:"equals",value:"M"}	values: {fieldName:"Sex",operator:"equals",value:"M"}
    === 2012-03-13 18:36:46,144 [l0-3] INFO  SQLDataSource - [builtinApplication.Employees_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
    === 2012-03-13 18:36:46,147 [l0-3] DEBUG SQLDataSource - [builtinApplication.Employees_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
    === 2012-03-13 18:36:46,148 [l0-3] DEBUG SQLDataSource - [builtinApplication.Employees_fetch] Eval'd row count query: SELECT COUNT(*) FROM employees WHERE (employees.Sex = 'M' AND employees.Sex IS NOT NULL)
    === 2012-03-13 18:36:46,148 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Employees_fetch] DriverManager fetching connection for manifest via jdbc url jdbc:mysql://localhost:3306/manifest
    === 2012-03-13 18:36:46,149 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Employees_fetch] Passing credentials getConnection separately from JDBC URL
    === 2012-03-13 18:36:48,658 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Employees_fetch] Returning pooled Connection
    === 2012-03-13 18:36:48,659 [l0-3] INFO  SQLDriver - [builtinApplication.Employees_fetch] Executing SQL query on 'manifest': SELECT COUNT(*) FROM employees WHERE (employees.Sex = 'M' AND employees.Sex IS NOT NULL)
    === 2012-03-13 18:36:48,831 [l0-3] DEBUG SQLDataSource - [builtinApplication.Employees_fetch] Using SQL Limit query
    === 2012-03-13 18:36:48,831 [l0-3] DEBUG SQLDataSource - [builtinApplication.Employees_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT employees.CabinAssignments, employees.CabinNumber, employees.CompanyId, employees.Completeness, employees.CountryOfCitizenship, employees.CountryOfResidence, employees.DateOfBirth, employees.DisembarkDate, employees.EmbarkDate, employees.EmployeeId, employees.FirstName, employees.LastEdited, employees.LastName, employees.OwnedBySubUser, employees.PassportAssignedCountry, employees.PassportExpiration, employees.PassportNumber, employees.Position, employees.PrimaryEmail, employees.PrimaryPhone, employees.ResidentNumber, employees.Sex, employees.SubContractorName, employees.VisaNumber, employees.VisaType FROM employees WHERE (employees.Sex = 'M' AND employees.Sex IS NOT NULL) LIMIT 0, 75
    === 2012-03-13 18:36:48,832 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Employees_fetch] DriverManager fetching connection for manifest via jdbc url jdbc:mysql://localhost:3306/manifest
    === 2012-03-13 18:36:48,832 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Employees_fetch] Passing credentials getConnection separately from JDBC URL
    === 2012-03-13 18:36:49,012 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.Employees_fetch] Returning pooled Connection
    === 2012-03-13 18:36:49,035 [l0-3] INFO  DSResponse - [builtinApplication.Employees_fetch] DSResponse: List with 75 items
    === 2012-03-13 18:36:49,036 [l0-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2012-03-13 18:36:49,038 [l0-3] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2012-03-13 18:36:49,447 [l0-3] INFO  Compression - /testbed/sc/IDACall: 36780 -> 4034 bytes
    === 2012-03-13 18:36:54,200 [l0-6] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vscroll_track_start.png
    === 2012-03-13 18:36:54,205 [l0-5] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vscroll_track.png
    === 2012-03-13 18:36:54,207 [l0-3] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vscroll_start.png
    === 2012-03-13 18:36:54,241 [l0-6] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vthumb_start.png
    === 2012-03-13 18:36:54,241 [l0-8] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vthumb_grip.png
    === 2012-03-13 18:36:54,243 [l0-4] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vscroll_track_end.png
    === 2012-03-13 18:36:54,245 [l0-7] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vscroll_end.png
    === 2012-03-13 18:36:54,245 [l0-5] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vthumb_stretch.png
    === 2012-03-13 18:36:54,248 [l0-3] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\Scrollbar\vthumb_end.png
    === 2012-03-13 18:37:37,987 [l0-7] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\ListGrid\header_menu.gif
    === 2012-03-13 18:40:15,022 [l0-4] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\Adrian\Progamming\WebApps\TestBed\war\testbed\sc\skins\TreeFrog\images\ListGrid\header_Over.png

    Anything else that I may provide to help resolve this issue?

    Comment


      #3
      I decided to substitute Criterion for AdvancedCriteria and that worked for me.

      So I was able to use my filter again by doing ListGrid.setCriteria(new AdvancedCriteria());

      So it seems that there is a bug using ListGid.setCriteria(new Criterion()) and filtering.

      Hope this helps someone.

      Comment

      Working...
      X