DragAgent"

From Documentation
(Created page with "{{ZATSEssentialsPageHeader}} <tt> DragAgent </tt> makes you mimic dragging a component and drop on another component. You have to query the component you want to drag first an...")
 
Line 3: Line 3:
  
  
<tt> DragAgent </tt> makes you mimic dragging a component and drop on another component. You have to query the component you want to drag first and  
+
<tt> DragAgent </tt> makes you mimic dragging a component and drop on another component. You have to query the component you want to drag first and convert it as <tt> DragAgent </tt> then call <tt> dropOn(ComponentAgent) </tt>. The argument you pass into the method is the target component you want to drop on.
convert it as <tt> DragAgent </tt> then call <tt> dropOn(ComponentAgent) </tt>. The argument you pass into the method is the target component you want to drop on.
 
  
 
The following code presents how to drag a ''listitem'' from left ''listbox'' to right ''listbox''.
 
The following code presents how to drag a ''listitem'' from left ''listbox'' to right ''listbox''.

Revision as of 03:02, 14 May 2012



DragAgent makes you mimic dragging a component and drop on another component. You have to query the component you want to drag first and convert it as DragAgent then call dropOn(ComponentAgent) . The argument you pass into the method is the target component you want to drop on.

The following code presents how to drag a listitem from left listbox to right listbox.

		//move 1 item from left to right
		ComponentAgent draggedItem = leftBox.query("listcell[label='ZK Forge']").getParent();
		draggedItem.as(DragAgent.class).dropOn(rightBox);




Last Update : 2012/05/14

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.