Announcement

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

    FilterBuilder options changed between smartclient 10.0 and smartclient 12.0 to not include iEquals for integers

    Hello,

    We are in the process of upgrading from smartclient 10.0 to smartclient 12.0. We have many users who have stored a viewstate with advanced filtering based on the Filterbuilder component available in 10.0. In 10.0, the best option for Integer values was "equals (ignore case)" or "iEquals". That option is no longer available for integers in the FilterBuilder in 12.0. As a result, filters built with smartclient 10.0 are broken because iEquals no longer applies. What is the recommended way to upgrade these legacy view states that are stored in our Database? Should we run an update script to just change any instance of "iEquals" to "equals"? There is not an easy way to determine if iEquals needs to be changed for an example like this because it is not easy to determine programmatically in this example if securityTypeID is an integer:

    { "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "fieldName":"securityTypeID", "operator":"iEquals", "value":"27" } ] }

    Or, is there some way to alter the FilterBuilder logic to be backwards compatible so that iEquals is simply converted to "equals" so that our application doesn't break when attempting this upgrade?

    #2
    The easiest way to handle this is probably to add the iEquals operator to the list of valid options within your filterBuilder.

    FilterBuilder calls the method filterBuilder.getFieldOperators to get the list of valid operators per field. By default this will fall through to the equivalent DataSource method which in turn calls dataSource.getTypeOperators().

    If you want a general solution for all Integer values, you could therefore add iEquals to the type operators for Integer fields.

    Comment

    Working...
    X