Hello Tapestry List,

Firstly, Sorry to harass your inboxes the last 12 or so hours.  But I found 
something someone may want to have a look into!
I've used the draggable sample from http://docs.jquery.com/UI/Draggable

Note that jquery.ui.mouse must come before jquery.ui.draggable in the 
@ImportJQueryUI() declaration.


Here are my samples

js/draggable.js
  $(document).ready(function() {
    $("#draggable").draggable();
  });

layout/draggable.css
#draggable {
        width: 100px;
        height: 70px;
        background: silver;
}


Draggable.tml
<html t:type="layout" title="Contact org.opencsta"
        xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"; 
xmlns:p="tapestry:parameter">

        <p>JQuery Testing</p>

<div id="draggable">Drag me</div>

</html>




DOES NOT WORK  Draggable.java
@ImportJQueryUI({"jquery.ui.core", "jquery.ui.draggable", "jquery.ui.mouse"})
@Import(stylesheet="context:layout/draggable.css",library="context:js/draggable.js")
public class Draggable {

}

The errors from the javascript console in chrome are:
Uncaught TypeError: undefined is not a function
$.widgetjquery.ui.widget.js:61
(anonymous function)jquery.ui.draggable.js:17
(anonymous function)jquery.ui.draggable.js:823
draggable.js:2Uncaught TypeError: Object [object Object] has no method 
'draggable'
(anonymous function)draggable.js:2
jQuery.extend._Deferred.deferred.resolveWithjquery-1.6.2.js:1008
jQuery.extend.readyjquery-1.6.2.js:436
DOMContentLoadedjquery-1.6.2.js:915



DOES WORK!  Draggable.java
@ImportJQueryUI({"jquery.ui.core",  "jquery.ui.mouse", "jquery.ui.draggable"})
@Import(stylesheet="context:layout/draggable.css",library="context:js/draggable.js")
public class Draggable {

}

Reply via email to