Search code examples
gwtuibindererrai

Using gwt widgets in errai ui


I would like to know if it is possible to use complex gwt widgets like MenuBar or TabLayoutPanel in errai ui.

For example, how can I port the following uibinder to errai's ui template?

<g:MenuBar ui:field="menuBar">
    <g:MenuItem ui:field="helpMenuItem">Help</g:MenuItem>
    <g:MenuItem ui:field="aboutMenuItem">About</g:MenuItem>
    <g:MenuItem ui:field="siteMapMenuItem">Site Map</g:MenuItem>
</g:MenuBar>

I think I could use a <div> in the template, and bind it to a MenuBar, but I would have to construct the menu items programmatically in the view, which I want to avoid.

Thanks!


Solution

  • You have to construct the menu and its items programmatically if you want to stick only with Errai UI. However you could put the menu in a separate widget which could be built with UI-Binder.

    GWT's UI-Binder can represent Widgets as well as DOM elements whereas Errai UI only works with a DOM.