如何在程序中触发vaadin组合框的ValueChangeListener

时间:2017-07-20 18:58:34

标签: java combobox vaadin valuechangelistener

如何在程序中触发vaadin组合框的ValueChangeListener。 我有一个带有5个值的组合框,如果我将值设置为其中一个,如果在程序中,那么我想触发ValueChangeListener

    String statusFilterValue = STATUS_FILTER_DEFAULT;
    if (statusFilterComboBox.isEmpty())
    {
        statusFilterComboBox.addItem(STATUS_FILTER_DEFAULT);
        statusFilterComboBox.setNullSelectionAllowed(false);
        statusFilterComboBox.setTextInputAllowed(false);

        statusFilterComboBox.addItem(MY_CONFLICT_FILTER);
        for (ReferenceStatus item : ReferenceStatus.values())
            statusFilterComboBox.addItem(item);
    }
    else
    {
        statusFilterValue = (String) statusFilterComboBox.getValue();
    }
    statusFilterComboBox.setValue(statusFilterValue);
    // This is where I am trying to trigger the event
    statusFilterComboBox.select(statusFilterValue);
   statusFilterComboBox.addValueChangeListener(statusFilterComboBoxListener);

0 个答案:

没有答案