Announcement

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

    6.0p issue with switching filter fields that have different operators

    I believe this has been fixed in the latest 6.1p build but would it be possible to have it fixed in 6.0p? The issue is that if an advanced filter has fields that have different operators, switching between fields leaves the previous operator selected even if that operator is not available for the new field. In my standalone test case this can be seen by switching to the Country field, selected "contains" and switching back to the Code field which does not have the contains operator (see images attached as well).

    Click image for larger version

Name:	01.png
Views:	50
Size:	9.9 KB
ID:	251155

    Click image for larger version

Name:	02.png
Views:	55
Size:	11.9 KB
ID:	251154

    Click image for larger version

Name:	03.png
Views:	62
Size:	5.9 KB
ID:	251153

    On the console I see this warning which I also see in 6.1p, not sure if it is relevant: WARN:Log:Criterion specified unknown operator [null criterion]. Using the first valid operator (equals) instead

    This is my test case running under Firefox 57.0.4 (64-bit), MacOSX 10.13.2, GWT 2.7.0, SmartGWT 6.0p (v11.0p_2018-01-11).

    Code:
    DataSource worldDS = new DataSource();
    worldDS.setID("worldDS");  
    worldDS.setRecordXPath("/List/country");  
    DataSourceIntegerField pkField = new DataSourceIntegerField("pk");  
    pkField.setHidden(true);  
    pkField.setPrimaryKey(true);  
    
    DataSourceTextField countryCodeField = new DataSourceTextField("countryCode", "Code");  
    countryCodeField.setRequired(true);  
    countryCodeField.setValidOperators(OperatorId.EQUALS, OperatorId.NOT_EQUAL);
    
    DataSourceTextField countryNameField = new DataSourceTextField("countryName", "Country");  
    countryNameField.setRequired(true);  
    countryNameField.setValidOperators(OperatorId.EQUALS, OperatorId.NOT_EQUAL, OperatorId.CONTAINS);
    
    worldDS.setFields(pkField, countryCodeField, countryNameField);  
    
    worldDS.setClientOnly(true); 
    
    final FilterBuilder filterBuilder = new FilterBuilder();  
    filterBuilder.setDataSource(worldDS);  
    
    VStack vStack = new VStack(10);  
    vStack.addMember(filterBuilder);  
    vStack.draw();
    Thanks.
    Attached Files

    #2
    This fix has been backported to 6.0 - please retest with a build dated January 13 or later

    Comment

    Working...
    X