Menu

is there a way to deep copy data into an instance *preserving* what is already there?

2018-10-25
2018-11-11
  • Luis Tavera

    Luis Tavera - 2018-10-25

    Hi

    I am trying to implement an interface with two selects and a two buttons to move the selected items from the first to the second or from the second to the first, but when I do a deep copy of the items (as in the deep-copy.xml example) the destination is overwritten with the source data. Is there a way to insert without overwriting?

    thanks

    luis

     
  • Alain Couthures

    Alain Couthures - 2018-11-11

    Hi Luis,

    This might not be as easy as it seems to implement this with XForms.

    First, I would use select/itemset/copy to always have a copy of each set of selected items somewhere in a work instance.

    Then, each trigger should copy the corresponding selected items using insert at the end of the targeted select. Please have a look at https://www.w3.org/community/xformsusers/wiki/XForms_2.0#The_insert_Element for more details.

    Finally, deleting the inserted copy should be enough to refresh the initial select.

    This has not yet been tested with XSLTForms...

    Thank you for your feedback!

    --Alain

     

Log in to post a comment.