Creating a document fragment using plain Javascript is dead simple: var docFragment = document.createDocumentFragment();.
However, in GWT, this does not appear to be available, though there is a DocumentFragment interface in package com.google.gwt.xml.client that does not appear to be applicable. Does anyone know of a way, either using the aforementioned interface, or creating a class with a simple JSNI method that creates the documentFragment?
Thanks.
Creating a JSNI method returning a DocumentFragment is dead simple.. you just
return document.createDocumentFragment();🙂 The JSNI method should either returnJavaScriptObjector some other type that you know will work (likeNode– I’m not sure were you are going with this, but JSOs work that way – you cancast<T>()any subclass ofJavaScriptObjectto any otherJavaScriptObject).