Revision history [back]

click to hide/show revision 1
initial version

asked 2013-05-13 16:19:02 +0800

stalotto gravatar image stalotto

ZK drang and drop and databinding

I'm having a problem with ZK binding and drag and drop feature. I have tow listbox:

<listbox id="left" width="100%" model="@load(vm.contacts)" height="200px" draggable="true" droppable="true" ondrop="@command('move')">
<listhead> <listheader label="Contatto" align="center"/> </listhead> <template name="model" var="contact"> <listitem value="@bind(contact)" draggable="true" droppable="true" ondrop="@command('move')"> <listcell src="/img/contact-icon_x32.jpg" label="@load(contact.person.surname.concat(' ').concat(contact.person.name))"/> </listitem> </template> </listbox> ... <listbox width="100%" id="right" model="@load(vm.contactsQuickKey)" height="250px" draggable="true" droppable="true" ondrop="@command('move')" &gt;="" <listhead=""> <listheader label="Etichetta" align="center"/> <listheader label="Contatto" align="center"/> </listhead> <template name="model" var="contactQuickKey"> <listitem value="@bind(contactQuickKey)" draggable="true" droppable="true" ondrop="@command('move')"> <listcell>
<textbox width="90%" value="@load(contactQuickKey.label) @save(contactQuickKey.label, before={'move', 'saveData', 'setLeftActivePage'})"/> </listcell> <listcell src="/img/contact-icon_x32.jpg" label="@load(contactQuickKey.contact.person.surname.concat(' ').concat(contactQuickKey.contact.person.name))"/> </listitem> </template> </listbox>

If I edit the textbox in the right listbox and then immediately, without clicking anywhere, I drag and drop a cell from the left one, the text I added disappears. The only way I can save the text is to use an onchange event, but it is very heavy.

Does anyone can give me a better solution?

Thank you very much!

ZK drang and drop and databinding

I'm having a problem with ZK binding and drag and drop feature. I have tow listbox:

    <listbox id="left" width="100%" model="@load(vm.contacts)" height="200px" draggable="true" droppable="true" ondrop="@command('move')"> 
onDrop="@command('move')"> <listhead> <listheader label="Contatto" align="center"/> align="center" /> </listhead> <template name="model" var="contact"> <listitem value="@bind(contact)" draggable="true" droppable="true" ondrop="@command('move')"> onDrop="@command('move')"> <listcell src="/img/contact-icon_x32.jpg" label="@load(contact.person.surname.concat(' ').concat(contact.person.name))"/> ').concat(contact.person.name))" /> </listitem> </template> </listbox> ... <listbox width="100%" id="right" model="@load(vm.contactsQuickKey)" height="250px" draggable="true" droppable="true" ondrop="@command('move')" &gt;="" <listhead=""> onDrop="@command('move')" > <listhead> <listheader label="Etichetta" align="center"/> align="center" /> <listheader label="Contatto" align="center"/> align="center" /> </listhead> <template name="model" var="contactQuickKey"> <listitem value="@bind(contactQuickKey)" draggable="true" droppable="true" ondrop="@command('move')"> onDrop="@command('move')"> <listcell>
<textbox width="90%" value="@load(contactQuickKey.label) @save(contactQuickKey.label, before={'move', 'saveData', 'setLeftActivePage'})"/> </listcell> <listcell src="/img/contact-icon_x32.jpg" label="@load(contactQuickKey.contact.person.surname.concat(' ').concat(contactQuickKey.contact.person.name))"/> ').concat(contactQuickKey.contact.person.name))" /> </listitem> </template> </listbox>

If I edit the textbox in the right listbox and then immediately, without clicking anywhere, I drag and drop a cell from the left one, the text I added disappears. The only way I can save the text is to use an onchange event, but it is very heavy.

Does anyone can give me a better solution?

Thank you very much!

ZK drang and drop and databinding

I'm having a problem with ZK binding and drag and drop feature. I have tow listbox:

    <listbox id="left" width="100%" model="@load(vm.contacts)" height="200px" draggable="true" droppable="true" onDrop="@command('move')">                      
        <listhead>
            <listheader label="Contatto" align="center"  />
        </listhead>
        <template name="model" var="contact">
            <listitem value="@bind(contact)" draggable="true" droppable="true" onDrop="@command('move')"> 
                <listcell src="/img/contact-icon_x32.jpg" label="@load(contact.person.surname.concat(' ').concat(contact.person.name))" />
            </listitem>
        </template>
     </listbox>
...
    <listbox width="100%" id="right" model="@load(vm.contactsQuickKey)" height="250px" draggable="true" droppable="true" onDrop="@command('move')" >
        <listhead>
             <listheader label="Etichetta" align="center"  />
             <listheader label="Contatto" align="center"  />
        </listhead>
        <template name="model" var="contactQuickKey">
             <listitem value="@bind(contactQuickKey)" draggable="true" droppable="true" onDrop="@command('move')">
                 <listcell>                                   
                     <textbox width="90%" value="@load(contactQuickKey.label) @save(contactQuickKey.label, before={'move', 'saveData', 'setLeftActivePage'})"/>
                 </listcell>
                 <listcell src="/img/contact-icon_x32.jpg" label="@load(contactQuickKey.contact.person.surname.concat(' ').concat(contactQuickKey.contact.person.name))" />
             </listitem>
       </template>
    </listbox>

If I edit the textbox in the right listbox and then immediately, without clicking anywhere, I drag and drop a cell from the left one, the text I added disappears. The only way I can save the text is to use an onchange event, but it is very heavy.

Does anyone can give me a better solution?

Thank you very much!

ZK drang and drop and databinding

I'm having a problem with ZK binding and drag and drop feature. I have tow listbox:

    <listbox id="left" width="100%" model="@load(vm.contacts)" height="200px" draggable="true" droppable="true" onDrop="@command('move')">                      
        <listhead>
            <listheader label="Contatto" align="center"  />
        </listhead>
        <template name="model" var="contact">
            <listitem value="@bind(contact)" draggable="true" droppable="true" onDrop="@command('move')"> 
                <listcell src="/img/contact-icon_x32.jpg" label="@load(contact.person.surname.concat(' ').concat(contact.person.name))" />
            </listitem>
        </template>
     </listbox>
...
    <listbox width="100%" id="right" model="@load(vm.contactsQuickKey)" height="250px" draggable="true" droppable="true" onDrop="@command('move')" >
        <listhead>
             <listheader label="Etichetta" align="center"  />
             <listheader label="Contatto" align="center"  />
        </listhead>
        <template name="model" var="contactQuickKey">
             <listitem value="@bind(contactQuickKey)" draggable="true" droppable="true" onDrop="@command('move')">
                 <listcell>                                   
                     <textbox width="90%" value="@load(contactQuickKey.label) @save(contactQuickKey.label, before={'move', 'saveData', 'setLeftActivePage'})"/>
                 </listcell>
                 <listcell src="/img/contact-icon_x32.jpg" label="@load(contactQuickKey.contact.person.surname.concat(' ').concat(contactQuickKey.contact.person.name))" />
             </listitem>
       </template>
    </listbox>

If I edit the textbox in the right listbox and then immediately, without clicking anywhere, I drag and drop a cell from the left one, the text I added disappears. The only way I can save the text is to use an onchange event, but it is very heavy.

Does anyone can give me a better solution?

Thank you very much!

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More