masterdany88
masterdany88

Reputation: 5351

How to convert errai's: HTMLElement, Node into gwt widget?

I've errai's widget of HTMLElement type. I would like to put into current page content from org.jboss.errai.ui.nav.client.local.Navigation class as follow:

IsWidget widget = navigation.getContentPanel();

SimplePanel.add(IsWidget widget);

but in errai in html templates java file HTMLElement is used.

Upvotes: 0

Views: 252

Answers (1)

quarks
quarks

Reputation: 35346

This is the proper way to this:

@Templated
@EntryPoint
public class App extends Composite {

    @Inject
    Navigation navigation;

    @Inject @DataField
    private SimplePanel content;

    @PostConstruct
    public void buildUI() {
        content.add(navigation.getContentPanel());
        RootPanel.get("rootPanel").add(this);
    }
}

Having a template that looks like this:

<div>
     <div id="content"></div>
</div>

Upvotes: 1

Related Questions