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

    Filters formula fields

    Hi Isomorphic.

    I have a test environment with the BuiltInDs project that uses the following components:
    JDK 1.8
    SmartGWT Eval v13.0p_2023-08-16

    In the BuiltInDs project we added a formula field and modified the setCanFilter attribute so that it can be filtered, but when we try to filter and switch to another field we get a dot in the formula field filter.
    Here I attach a video of the behavior and the part of the code where we add the new field:

    Click image for larger version  Name:	Isomorphic2.png Views:	0 Size:	200.6 KB ID:	270751
    Attached Files
    Last edited by cochoa1; 17 Aug 2023, 12:39.

    Formula fields are canFilter:false by default by design because there is no way to perform the same filtering on the server.

    If you are interested in sponsoring features, there are two possible designs here, ready to implement:

    1. support for server-side formula fields

    This would allow full filtering, although you might want to restrict creation of such fields to admins.

    2. support for filtering formula fields only when the entire matching set of records for non-formula criteria is cached

    This has a somewhat complicated UI, because if criteria on other fields are changed such that only part of the dataset is cached, you need to notify the user that their filters on formula fields have been disabled, and offer to cancel those criteria or re-enable them later when possible.

    Another, application-level possibility is to create a clientOnly:true DataSource with a subset of your data and pre-computed formula values - so what used to be a formula field is just a normal field. Then normal filtering is possible.


      We had version 4 and there the filtering for the formula fields worked well, even in version Eval v13.0p_2023-08-16 the summary Field does not present this problem (no point comes out when changing column).


        No, it does not work properly in any version, due to the previously explained issues.

        You might have seen it appear to work if all data happened to be loaded. You can get the same behavior via as a clientOnly DataSource, as we also have already explained.