Announcement

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

    Filtering ComboboxItem from external parameters

    Hi.

    We're working from SmartClient Version: v9.1p_2015-10-28/Pro Deployment (built 2015-10-28). I'm mainly working from Chrome 49.0.2623.112 m

    What I'm trying to achieve is having a ComboBox's pickList filtered based on the state of options (checkboxes) on the same form. I'm aiming for the backend to return filtered data based on the options selected on the UI.

    I've experimented with pickListCriteria, adjusting criterion in reaction from the checkboxes changing. However, the criterion I'm aiming to send are not directly related to the fields on the picker's dataSource. Form my understanding, the dataSource will only pass the criterion through GET if the criterion's fieldName matches the fields of the dataSource.

    I've also experimented with optionCriteria (which, if I understand properly, I could not change on the fly after the ComboBox has been created) - with similar results.

    Can I use the criteria the way I aim to ? If so, what am I missing ? Otherwise, how should I go about passing them parameters ?

    Thanks!

    #2
    Setting a PickListCriteriaFunction is the right way to provide criteria that can change at any time.

    You will need the fields to be declared in your DataSource, yes. For filtering and serialization of request parameters to be performed correctly, we need at least the field's type.

    Comment


      #3
      Thanks - I'll look if we can work something in there that would not be too costly.

      I've also stumbled upon DataSource.transformRequest, which sounds rather promising.

      However it does not seem to get called. It gets through a similar method in RPCManager, but DataSource doesnt seem to call transformRequest.

      It seems to stem from the fact that the DataSource's dataFormat has been set to `json` (and not `iscServer`).
      Last edited by eric.maziade.afsi; 5 May 2016, 13:00.

      Comment


        #4
        Originally posted by Isomorphic View Post
        Setting a PickListCriteriaFunction is the right way to provide criteria that can change at any time.

        You will need the fields to be declared in your DataSource, yes. For filtering and serialization of request parameters to be performed correctly, we need at least the field's type.

        That worked fantastically - thanks !

        Comment

        Working...
        X