-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hey guys,
I'm looking for 2 event for drag and drop operations:
1. An event that gets fired when the D&D operation has started.
2. An event that gets called WHILE the user is dragging an item.
Are there such events in ZK? I've been searching for some time now but couldn't find anything.
Hey guys!
Please help
As I can do to get event.getTarget () on the controller?
public void onStartDrag(Event event) {
Label label = (Label) event.getTarget();
}
when executing the method onStartDrag event.getTarget () is null.
Hm, can you provide a really simple, runnable example? (e.g. with ZK Fiddle)
..neata back :)
for example the layout is defined in an index.zul where <include /> is used and the applied controller sets the source of the include as page1.zul. the drag event defined in the page1.zul is not recognized in index.zul. if i understood correctly, by using include it crosses over desktops. so the above mentioned method with desktop will not cross desktops.
Neata,
what do you mean by "include"?
..neata means morning in romanian :)
by the way, $widget.desktop has a better coverage than $widget.parent. i'd recommend to use desktop instead
but desktop does not work when include is involved. does anyone know how can the original desktop of the include component be retrieved?
Nice,
but what's "neata"? :-)
ps: here are the widget packages if you wanna use panel (in zul.wnd) instead of label (in zul.wgt) for example, or any other zk components
have fun with it
iulia
..neata :p
found it! the specific call is made by the $widget in the javascript
zAu.send(new zk.Event($widget, 'onStartDrag', null));
public void onStartDrag(Event event) { System.out.println("Dragging started!"); }
..you are right. it is general in the javascript code but it is specific in the controller on the label_test id
onStartDrag$label_test
Hm, did you test that code?
For me, it looks like if this line applies to ALL labels, so it is already generalized and not id-specific:
zul.wgt.Label.prototype.getDragOptions_ = ....
Asked: 2012-01-28 09:55:26 +0800
Seen: 462 times
Last updated: Aug 06 '12