-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to use the mouse to move zk textbox from one position in a container to another in the same container? how do I do that? Does anyone have an example? Thanks
Hello vicnetepc,
Got the following script from this forum post:
http://forum.zkoss.org/question/96340/drag-and-drop-in-textbox/
<?page title="Drop Test" contentType="text/html;charset=UTF-8"?>
<zk>
<vlayout>
<label draggable="true" style="cursor: pointer;">Drag me into the textbox </label>
<panel onDrop="dropped(event.dragged)" droppable="true" width="50%" border="normal">
<panelchildren>
<div align="center">
<textbox id="globalSearch" width="100%" placeholder="drag here your question" />
</div>
</panelchildren>
</panel>
</vlayout>
<zscript><![CDATA[
public void dropped(Component dragged) {
if (dragged instanceof Label)
globalSearch.setValue( ((Label)dragged).getValue() );
}
]]></zscript>
</zk>
Best,
Darksu
Asked: 2017-04-11 17:01:08 +0800
Seen: 35 times
Last updated: Apr 16 '17