Menubar at the bottom

Hi vaadin community,

Here my problem:

On the bottom of my screen I have 1 menu, when it drops down it sadly enough still goes down(has to go up to be visible). Normally with scrollbar not a problem only thing is I don’t use a scrollbar. Now chat told me that VMenuBar lacks a check for the bottom of the screen.
So i am 1 step further, but Is there a way for me to implement that check by myself ?

If needed I shall give more information.

The submenus in MenuBar component only open downward.

The PopupView is more flexible in its positioning, but it doesn’t suit very well for creating menu bars.

has several add-ons for popup menus, perhaps some of them support opening also upward.

If you are not afraid of a little client side coding, you
be able to tweak this by subclassing VMenuBar on the client side and replacing the default implementation with yours using GWT deferred bindings. The key methods are showChildMenu() and showChildMenuAt(). However, this can be tricky as you might have to let the system first render the submenu before knowing what size it will have, and then move it up until it is completely on the screen and perhaps also above the main menu bar. VMenuBar already does something similar horizontally (move submenu left so that fully visible), but that might not be the best place to look for an example as it is triggered by loading of icons etc. in another location.

You might also want to make the main menu open on the “up” arrow, not the “down” arrow.

Thank you all for the response,

Question the gwt deferred binding is it possible in netbeans or do you need the plugin from in eclipse ?

Nothing Eclipse specific there - the Eclipse plugin just makes it easier to recompile a widgetset, but you can get e.g. an Ant script for doing it in NetBeans from the
add-on help page
and see the
book chapter on widget development
(which uses Eclipse for most examples, though).

Deferred bindings are specified with a few lines of XML in your widgetset .gwt.xml file to tell the GWT compiler to use your implementation when it would normally use another class - see e.g.
this page
. This requires that the class to replace is created with GWT.create() rather than a direct constructor call, but all Vaadin top-level client side widgets like VMenuBar are.