Announcement

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

    inSet missing in allowed enum operators?

    Hi,

    I created a custom class inheriting from SelectItem and used it as a filterEditorType for fields of type enum. I set:
    • multiple: true
    • operator: inSet

    and while using it I get warnings from SmartClient:
    Code:
    *15:59:05.518:MUP9:WARN:DataSource:cellsDS:Operator inSet is not valid for field TECH. Continuing anyway.
    Why is inSet not mentioned in allowed type operators for enum? Result of:
    Code:
    (isc.DataSource.create()).getTypeOperators("enum")
    doesn't contain inSet and notInSet. I believe it should.

    Version: v10.1p_2016-02-12/PowerEdition Deployment

    I did it because I heed to run updates on filtered data, and update operations treat equals with array parameters different than fetches do. Eg. with criteria:
    Code:
    fieldName: "field"
    operator: "equals",
    value: [1, 2]
    fetch constructs "field IN (1, 2)", while update does "field = '[1, 2]'"

    Is it a bug, or correct behavior? If correct, can I tell update to build criteria in the same way as fetch does?

    #2
    "inSet" doesn't appear in the default list of operators because there is no default UI for a user to pick the set of options. You would need to provide one (see Operator.editorType) or use Feature Sponsorship to have the capability adding to the framework.

    By default, updates can only be one by primaryKey - see operationBinding.allowMultiUpdate.

    Comment


      #3
      Thanks for explaining.

      As for criteria, it happened in my server side code, where I was using "SQLDataSource.getSQLClause(SQLClauseType.Where, ...) without normalizing my criteria via DataSource.normalizeAdvancedCriteria. Now I got it to work correctly.

      Comment

      Working...
      X