Announcement

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

    SmartGWT 2.5 FilterBuilder set operators.

    SmartGWT 2.5 build date: 07/12/2011 06:40

    Neither DataSourceTextField.setValidOperators nor DataSource.setTypeOperators seem to alter the list of operators in the FilterBuilder. When either of them is set only "equals" and "not equals" appear in the list of operators. Please run the attached test case.
    Attached Files

    #2
    I'm able to set the operators for a given field in the filter builder like so:

    Code:
    	public void setStringConditions(DataSourceField field)
    	{
    		field.setValidOperators( OperatorId.EQUALS, OperatorId.ICONTAINS, OperatorId.ISTARTS_WITH, OperatorId.IENDS_WITH,
    				OperatorId.INOT_CONTAINS, OperatorId.INOT_STARTS_WITH, OperatorId.INOT_ENDS_WITH, OperatorId.IS_NULL,
    				OperatorId.NOT_NULL );
    	}

    Comment


      #3
      Are you using the nightly builds for smart-gwt 2.5?

      Comment


        #4
        Hi,

        I am using LGPL/2011-08-01 smartgwt nightly build.

        I was trying to set custom set of operators for the FilterBuilder. Here are the results:

        Does not work (the result is only EQUALS operator):
        Code:
        DataSourceField field = new DataSourceTextField("name", "label");
        field.setValidOperators(OperatorId.CONTAINS, OperatorId.EQUALS);
        Does not work (the result is only EQUALS operator):
        Code:
        RestDataSource ds = ....
        ds.setTypeOperators(FieldType.TEXT, new OperatorId[] { OperatorId.CONTAINS, OperatorId.EQUALS } );
        Does work (shows both 'contains' and 'equals' operators):
        Code:
        DataSourceField field = new DataSourceTextField("name", "label");
        field.setValidOperators(OperatorId.ICONTAINS, OperatorId.EQUALS);
        Does work (shows both 'contains' and 'equals' operators):
        Code:
        RestDataSource ds = ....
        ds.setTypeOperators(FieldType.TEXT, new OperatorId[] { OperatorId.ICONTAINS, OperatorId.EQUALS } );
        This second working example is nice at least in a way that it is sufficient to set the operators once per field type and it is not necessary to set it for each field separately.

        The difference I can see is ICONTAINS vs CONTAINS. Though it is not clear to me why the CONTAINS is not accepted even when it is a valid member of the OperatorId enumeration.

        I did not try the rest of the operators.

        Comment


          #5
          Contains, between, Starts with, and Ends width all don't seem to work even though they are valid operator enums. In the 2.5 release notes it says there is a new IbetweenInclusive operater yet there is no Operator enum for it.

          Comment

          Working...
          X