I think It's a good idea, js scripts will be easier to maintain and to read. Where can I find samples of Velocity JavaScript templates uses?

Jean-Baptiste Quenot a écrit :
* [EMAIL PROTECTED]:
Log Message:
-----------
DragAndDrop Orderable listView

Modified: 
trunk/wicket-contrib-dojo/src/main/java/wicket/contrib/dojo/dojodnd/DojoDropContainerHandler.java
===================================================================
--- 
trunk/wicket-contrib-dojo/src/main/java/wicket/contrib/dojo/dojodnd/DojoDropContainerHandler.java
   2006-11-12 20:04:46 UTC (rev 1116)
+++ 
trunk/wicket-contrib-dojo/src/main/java/wicket/contrib/dojo/dojodnd/DojoDropContainerHandler.java
   2006-11-14 18:26:19 UTC (rev 1117)
@@ -59,11 +59,7 @@
                toReturn += "      var dl = byId(\"" + container.getId() + 
"\");\n";
                toReturn += "      var drop = new dojo.dnd.HtmlDropTarget(dl, [\"" + 
container.getDropId() + "\"]);\n";
                toReturn += "      dojo.event.connect(drop, 'onDrop', function(e) 
{\n";
-               toReturn += "              dojo.io.bind({\n";
-               toReturn += "                       url: createUrl(e),\n";
-               toReturn += "                       mimetype: 
\"text/plain\",\n";
-               toReturn += "                       load: function(type, data, evt) 
{}\n";
-               toReturn += "              });\n";
+               toReturn += "              
dojoUpdate(createUrl(e),function(){},function(){},function(){},'');";
                toReturn += "      });\n";
                toReturn += "}\n";
                toReturn += "dojo.event.connect(dojo, \"loaded\", \"initDrop" + 
container.getMarkupId() + "\");\n";

Hi Vincent,

Great stuff, thanks!

However, in the future we will likely have more and more
JavaScript code embedded in Java classes.

What do you think if we introduced a dependency from
wicket-contrib-dojo to wicket-contrib-velocity to be able to use
Velocity JavaScript templates instead of ugly and inefficient
String concatenations?


--
Vincent Demay
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)561 000 649
Fax : +33 (0)561 005 146
http://www.anyware-tech.com/

Reply via email to