@ Override public void renderHead ( final Component _component , final IHeaderResponse _response ) { super . renderHead ( _component , _response ) ; _response . render ( RequireHeaderItem . forClasses ( DojoClasses . DnDSource , DojoClasses . parser ) ) ; if ( this . type == DnDBehavior . BehaviorType . SOURCE ) { final StringBuilder js = new StringBuilder ( ) . append ( "var nSrc = new dojo.dnd.Source(dom.byId('" ) . append ( _component . getMarkupId ( true ) ) . append ( "')," ) . append ( "{ accept: ['" + this . dndType + "']});" ) . append ( " aspect.after(nSrc,\"onDrop\", function(){\n" ) . append ( this . appendJavaScript ) . append ( "\n});" ) ; _response . render ( OnDojoReadyHeaderItem . forScript ( DojoWrapper . require ( js , DojoClasses . aspect , DojoClasses . dom , DojoClasses . DnDSource ) ) ) ; } }
Add the javascriupt to the head of the webpage .