Alexei
Alexei

Reputation: 15694

Not compile project after migrate from Vaadin 7 to Vaadin 8

Current version of Vaadin is 7.3.6

Here some my code:

import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

private NativeSelect currencySelector;

private void initCurrencySelector(String providerId) {
    currencySelector = new NativeSelect();
    List<String> selectCurrencyList;
    currencySelector.removeAllItems();
}

And this code success compile.

But after I try to upgrade to Vaadin 8.12.0 then this code not compile.

error in this lines:

import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.event.FieldEvents.TextChangeEvent;
import com.vaadin.event.FieldEvents.TextChangeListener;

and in this line:

currencySelector.removeAllItems();

Upvotes: 0

Views: 52

Answers (1)

tremendous7
tremendous7

Reputation: 751

the new imports should be

import com.vaadin.data.HasValue.ValueChangeEvent;
import com.vaadin.event.FieldsEvent

TextChangeEvent and TextChangeListener probably were replaced by HasValue.ValueChangeEvent and HasValue.ValueChangeListener

currencySelector.removeAllItems(); should be

currencySelector.setDataProvider(new ListDataProvider(new ArrayList()));

a list of incompatible changes can be found here https://vaadin.com/download/prerelease/8.0/8.0.0/8.0.0.beta1/release-notes.html#incompatible

Upvotes: 1

Related Questions