Skip to Content
avatar image
Former Member

Remove Selected Element in ItemListBox

Hi All,

          There are two ItemList Boxes Say( A,B). I selected an item from List A and once I click on Button the selected item gets added to List B. But I want the selected item to be removed from List A once it gets added to List B.I tried the removeelement but did not work.

wdcontext.nodeA.removeelement(element name);

Also when i select an element in List B and try to remove, always first element is getting selected and removed. Here, i used the above removeelement(element name). The lead selection is always set to 0. I am not able to change leadselection even after selecting other elements. Please help me regarding these two issues.

thanks,

Nooruddin

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 18, 2013 at 09:43 AM

    Hi Nooruddin,

    try this way:

    wdContext.nodeA().removeElementAt(wdContext.nodeA().getLeadSelection());

    Setting the leadselection works this way:

    wdContext.nodeA().setLeadSelection(3);  // this focuses on the 4th element, since indexing starting from 0

    I hope this helps.

    Regards,
    Ervin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Ervin Szolke

      Thank you  Ervin and Sharath. You helped me a lot in this. The drag and drop document was a good learning for me. Will try to implement that in future. But for now the Client just wants to have two item list boxes with buttons. I was able to remove the elements now...

      thanks,

      Nooruddin