protected CharSequence getCallBackScript ( final String _url ) { final StringBuilder js = new StringBuilder ( ) . append ( "baseWindow.withDoc(top.dojo.doc, function () {\n" ) . append ( "var node = dom.byId('downloadFrame');\n" ) . append ( "if (node == null) {\n" ) . append ( "node = domConstruct.place('<iframe id=\"downloadFrame\" src=\"about:blank\" " ) . append ( "style=\"position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; " ) . append ( "visibility: hidden\">', win.body());\n" ) . append ( "}\n" ) . append ( "node.src='" ) . append ( _url ) . append ( "';" ) . append ( "});\n" ) ; return DojoWrapper . require ( js , DojoClasses . baseWindow , DojoClasses . dom , DojoClasses . domConstruct ) ; }
Script that searches for an existing iframe to use it for the download of the frame . If it does not exist it will be created .