Some methods are not present while updating from vaadin7 to vaadin8

70 Views Asked by At

Update from vaadin 7.7.6 to vaadin 8

I am trying to upgrade my project from java8 to java11 and from vaadin7 to vaadin8. I am not able to find the alternatives for few vaadin methods in vaadin 8. The methods are related to the below classes.

import org.vaadin.peter.contextmenu.ContextMenu;
import org.vaadin.peter.contextmenu.ContextMenu.ContextMenuItem;
import org.vaadin.peter.contextmenu.ContextMenu.ContextMenuItemClickEvent;
import org.vaadin.peter.contextmenu.ContextMenu.ContextMenuItemClickListener;
import com.avaya.ept.dr.ra.view.contexmenu.ContextMenuContent;

In my existing code I have below methods :

final ContextMenu contextMenu = new ContextMenu();
if (someConditionHere) {
   contextMenu.addItem("some caption here... ");
}else {
   ContextMenuItem item;
   item = contextMenu.addItem("someString");
   item.setData(someObject);
   item.setEnabled(false);
}

Since in vaadin8 ContextMenuItem is not present so What could be the alternative for the above block of code.

My second question is in the below code we are using ComboBoxMultiSelect which has a method combo.addItem(string) but in vaadin8 what could be the replacement for this method ?

AbstractField abstractField = RaComponentFactory.getFactory().createComponent(NAME, "LUT_"
                        + dim.getName()+ "_" + rowCreationCounter, ComboBoxMultiSelect.class);
        final com.avaya.ept.dr.ra.view.components.ComboBoxMultiSelect combo = (ComboBoxMultiSelect)abstractField;
combo.addItem(string);

My third question is in the interface public interface Component extends ClientConnector, Sizeable, Serializable we are having a method void setReadOnly(boolean var1); which is not present in vaadin8 so what could be the alternative for this method ?

Please provide some suggestions here. Thanks in advance!

0

There are 0 best solutions below