I am experiencing behavior with context menus where children of an item do not show up in version 7.7.7 not 7.7.10. I reverted back to 7.6.8 and it works fine. I get a cryptic Javascript error which I interpret to be the equivalent of a NullPointerException:
Thu Jun 15 12:20:25 GMT-400 2017 com.vaadin.client.ApplicationConfiguration
SEVERE: (TypeError) : Cannot read property 'bc' of undefinedcom.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'bc' of undefined
My code did not change between switching versions, but this is how I am constructing the context menu:
private com.vaadin.addon.contextmenu.MenuItem copyMenuItem( final MenuItem menuItem )
{
com.vaadin.addon.contextmenu.MenuItem contextMenuItem = addItem(
Strings.isNullOrEmpty( menuItem.getText() ) ? menuItem.getDescription() : menuItem.getText(),
menuItem.getIcon(),
convertCommandFromMenuItem( menuItem ) );
contextMenuItem.setDescription( menuItem.getDescription() );
contextMenuItem.setEnabled( menuItem.isEnabled() );
contextMenuItem.setVisible( menuItem.isVisible() );
if ( menuItem.hasChildren() )
{
for ( MenuItem childMenuItem : menuItem.getChildren() )
{
contextMenuItem.addItem( childMenuItem.getText(), childMenuItem.getIcon(),
convertCommandFromMenuItem( childMenuItem ) );
}
}
return contextMenuItem;
}
private com.vaadin.addon.contextmenu.Menu.Command convertCommandFromMenuItem( final MenuItem menuItem )
{
if ( menuItem.getCommand() == null )
return null;
return new com.vaadin.addon.contextmenu.Menu.Command()
{
private static final long serialVersionUID = 2629955184138771256L;
@Override
public void menuSelected( com.vaadin.addon.contextmenu.MenuItem selectedItem )
{
menuItem.getCommand().menuSelected( menuItem );
}
};
}