Announcement

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

    FilterBuilder Contains vs InSet vs Equals for enum with multple values?

    I have a field declared like:

    Code:
    <field name="myEnum" type="integer" multiple="true">
         <valueMap>
             <value ID="1">A</value>
             <value ID="2">B</value>
             <value ID="4">C</value>
             <value ID="8">D</value>
             <value ID="16">E</value>
             <value ID="32">F</value>
         </valueMap>
     </field>
    When using a FilterBuilder to filter on the field, what is the expected behaviour of Contains, InSet and Equals?

    For example if I select "contains" and select values A, B, C will it show me only the rows that contains all 3 of these values (basically an AND)?

    If I select "is one of" (inSet) A, B, C will it sow me the rows that where that field contains any of the values (OR).

    If I select "equals" A, B, C will it only show me the rows that have that field set exactly to A, B, C?

    That is the behaviour I was expecting but not what I am seeing.

    Thanks!

    #2
    Take a look at the docs on dataSourceField.multiple - there's extensive discussion of what behaviors are supported client-side and server-side, and also of how it relates to dataSourceField.multipleStorage.

    Comment


      #3
      Thanks for the pointer.

      What I was not clear on was when the criteria value contains multiple values what happens. The doc states:

      For simple Criteria, the criteria value is compared to each field value in the multiple:true field, according to the textMatchStyle. If any field value matches the filter value, the field is considered to match the criteria.
      For AdvancedCriteria, for normal search operators the field value is considered as matching the Criterion if any of the field values match the Criterion.


      Seems like it is if any value in the criterion matches any value in the field it is considered matched. Is that correct?

      Comment


        #4
        That's correct - for client filtering and some settings of server filtering. Are you seeing a situation where we're not following the docs? If so, how can we reproduce it?

        Comment


          #5
          No problem just wanted to make sure that was the expected behaviour. Thanks.

          Comment

          Working...
          X