Announcement

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

    selectItem.setValues(String...values) not working for select item having two fields

    Hello,

    I am using chrome browser and SmartClient Version: v11.0p_2017-02-11/PowerEdition Deployment (built 2017-02-11)

    There is a select item having two fields set as pick list fields and i have also set multiple=true. one field is set as display field and value field for this select item.

    While fetching data from backend i am setting comma separated string as value of list grid field. Now while edit that field of grid above select item is open in which i am setting values using .setValues(String....values). But this is not working as my records are not coming as selected at that time.

    Please help me out.

    Code:

    SelectItem AttrItem = new SelectItem();
    AttrItem.setWidth("300");
    final DataSource materialAttrDataSource = DataSource.get("MaterialAttr");
    ListGridField printCodeField= new ListGridField("abc","abc");
    ListGridField printDescriptionField= new ListGridField("des","des");
    AttrItem.setOptionDataSource("xyz");
    AttrItem.setMultiple(true);​
    AttrItem.setDisplayField("abc");
    AttrItem.setValueField("abc");​
    AttrItem.setPickListFields(printCodeField,printDescriptionField);​
    String attrValue = context.getEditedRecord().getAttribute(context.getEditField().getName()); // gives value as comma seperated strings of printCodeFields values that is also valuefield of select item.
    if (attrValue.length() != 0) {
    String[] attrValueArray = attrValue.split(",");
    AttrItem.setValues(attrValueArray);
    }​
    }

    #2
    Not reproducible: setValues() is working as expected in a quick test. Let us know if you can produce a minimal, ready-to-run test case showing an issue with this API.

    Comment

    Working...
    X