SmartGwt Select all options for Selectitem

I would like to select all the options for a select element that is somewhat set to true. Can I place it as a button or with some other components?

I tried using some buttons but it doesn't look good.

+3


source to share


1 answer


This can be done using Pickericon in SmartGWT. Use below code



    select = new SelectItem("TEMP" + "SAMPLE");
    select.setMultiple(true);
    select.setMultipleAppearance(MultipleAppearance.PICKLIST);
    select.setTitleAlign(Alignment.LEFT);
    select.setShowFocused(false);
    select.setShowDisabled(false);
    select.setShowErrorStyle(false);

    select_all = new PickerIcon(new Picker("checked.png"),
            new FormItemClickHandler() {

                @Override
                public void onFormItemClick(FormItemIconClickEvent event) {
                    //CODE to set all item to
                }
            });
    select_all.setPrompt("Select all");

    clear_all = new PickerIcon(PickerIcon.CLEAR,
            new FormItemClickHandler() {

                @Override
                public void onFormItemClick(FormItemIconClickEvent event) {

                    select.clearValue();
                }
            });
    clear_all.setPrompt("Clear selection");

    select.setIcons(select_all);

      

+3


source







All Articles