Vaadin 7 Notification

I put the following line of code into my program - after a failed login attempt:


      Notification.show("Invalid User Name and/or Password - please try again", Notification.TYPE_ERROR_MESSAGE);

This works correctly, as it did in Vaadin 6. However, Eclipse puts a strike-through on the TYPE_ERROR_MESSAGE and indicates that it is deprecated.
What is the correct replacement for showing INFO, WARNING and ERROR messages in Vaadin 7? The documentation still seems to indicate that TYPE_WARNING,
TYPE_ERROR_MESSAGE etc. are correct.

thanks,

nbc

The correct replacement is using the enum Type, which is a static inner type of Notification:

Notification.show("Error", Notification.Type.ERROR_MESSAGE);

I’m not sure about the correct names of the enum’s constants as I don’t have code-completion here ;)…

Missed that - thanks very much!

nbc

I’m having the same issue with ComboBox.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_ID)

The code works, but the constant is deprecated. Where can I find a list of the various enums that have been added to the system in release 7?

Thanks,

nbc

The javadoc for AbstractSelect.ITEM_CAPTION_MODE_ID tells you what to use (AbstractSelect.ItemCaptionMode.ID).

For most if not all of the constants replaced with enums, this should be the case.

EDIT: Updated ComboBox to the superclass AbstractSelect where the constants and the enum are actually defined.