Monday, September 11, 2017

How do you create a custom HTML element?

GWT doesn't support some HTML tags, which is frustrating. So I'd like to create my own Composite to achieve semantically correct HTML.

What's the best way to go about doing something like this without having to use native javascript calls to create the elements? Is it even possible?

For example:

public class DataList extends Composite {

        public DataList(){
                createElement("myDataList", "myParentElement", data); 

        public static native void createElement(String id, String parentId, List<String> data) /*-{

                var dl = $doc.createElement('datalist'); 

                  // code to populate the datalist



There's got to be a better way to do this, right? Preferably some method that works with UiBinder?

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment