1 Reply Latest reply on Jan 5, 2017 10:17 AM by mbarkley

    Creating DOM Elements on the fly ! (ManagedInstance<T extends JavaScriptObject>)


      How does one create native DOM elements on the fly ?


      ManagedInstance<T> works as expected for user defined @Templated objects. But while DOM dependencies are resolved using a simple @Inject of the same class, as far as I can tell, ManagedInstance cannot resolve dependencies for native JavaScriptObjects or DOM elements.. Example :



      private Image image; // Works as expected



      private ManagedInstance<Image> image; // Results in "Multiple beans matched com.google.gwt.core.client.JavaScriptObject$ with qualifiers { javax.enterprise.inject.Default }"


      Elements can be created using the GWT API, example :


      new Image("/img/source.jpg"))


      However there appears to be a inherent incompatibility between the GWT API and the Errai API.


      Is this functionality supported, what is the correct syntax ?