Announcement

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

    ComboboxItem setAllowExpressions don't work!

    Hello,
    i use

    Code:
     SmartClient Version: v10.0p_2015-04-21/PowerEdition Deployment (built 2015-04-21)
    on firefox 24.3.0.

    I create a combobox as follows:
    Code:
    ComboBoxItem cbi = new ComboBoxItem();
    cbi.setOptionDataSource(DataSource.get("optionDataSource"));
    ListGridField lgf1 = new ListGridField("lgf1", "lgf1");
    ListGridField lgf2 = new ListGridField("lgf2", "lgf2");
    cbi.setPickListFields(new ListGridField[]{lgf1, lgf2});
    cbi.setAllowExpressions(true);
    and set it to ListGridField
    Code:
     
    ListGrid lg = new ListGrid();
    lg.setOptionDataSource(DataSource.get("dataSource"));
    ListGridField lgf = lg.getField("optionField");
    
    lgf.setFilterEditorProperties(cbi);
    So I get combobox in filter editor. But if I use expressions in this field no data is shown.
    Any idea what going wrong or which settings must be done aditionally?

    With best regards

    #2
    This is by design - we would consider this a clashing and confusing mixture of two different UIs, as the entire interface of a ComboBox is dedicated to displaying iteratively filtered results, and that doesn't work with operators like "endsWith" or "greaterThan".

    We'd recommend just leaving this as a text field if you want to enable the allowExpressions feature.

    However, if you really wanted to implement this, you could use a getPickListFilterCriteria function to return criteria based on parsing the user input yourself, for the few operators that might make sense. Or, you could build a control that allows the end user to switch on the fly between using a ComboBoxItem vs picking a specific operator and using a plain TextItem for input.

    Comment


      #3
      Thank you for your reply.

      I will try to write a own parser for expressions.

      Comment


        #4
        I have implemented FormItemCriteriaFunction and its work fine for comboboxitem picklist. So if I enter expression picklist shows records that match expression. That is what I need. Since combobox is used in listgirds filtereditor I want filter with same expression in listgrid if I enter filter button.

        How can I realize this?

        Comment


          #5
          ?

          Hello Isomorphic,

          should I create new thread for my second issue in relation to combobox?

          Originally posted by Hock View Post
          I have implemented FormItemCriteriaFunction and its work fine for comboboxitem picklist. So if I enter expression picklist shows records that match expression. That is what I need. Since combobox is used in listgirds filtereditor I want filter with same expression in listgrid if I enter filter button.

          How can I realize this?

          Comment

          Working...
          X