Hawkansson
06-14-2017, 07:28 AM
Hi,
in one of my documents I've worked a lot with xml mapped content controls. Basically it is a large table with about 40 rows and 11 columns. All cells contain some sort of content Control (date picker, Rich text Control, Combo box Control etc.). Some of these content Controls are mapped to its own xml node. The xml structure goes something like this:
TableRow[1]
Date[1]
Time[1]
Frequency[1]
Mode[1]
Comment[1]
TableRow[2]
Date[1]
Time[1]
Frequency[1]
Mode[1]
Comment[1]
and so on. We use this as a test protocol at my job. Now sometimes a user wants to copy the information from example row 1 to row 2, and then modify the text within the content controls on row 2.
Now to the problem. As the user copy pastes the entire row 1, the mapped content controls gets duplicated. When the user then modifies the information on row 2, the information on row 1 also gets changed (since they are mapped to the same xml nodes).
I have tried to work with the EditPaste function, to try avoid mapped content controls to be duplicated. Basically the function is: "IF the source we are copying is a mapped content Control, THEN just paste the information within the content control rather than the content control itself." This works pretty well when the user copies one cell (one content control) at a time, but it doesn't work when a whole row of 11 different content controls is pasted to another row.
Can someone give me some tips about how to get around this? Are there more sofisticated ways to do this?
Best regards, David
in one of my documents I've worked a lot with xml mapped content controls. Basically it is a large table with about 40 rows and 11 columns. All cells contain some sort of content Control (date picker, Rich text Control, Combo box Control etc.). Some of these content Controls are mapped to its own xml node. The xml structure goes something like this:
TableRow[1]
Date[1]
Time[1]
Frequency[1]
Mode[1]
Comment[1]
TableRow[2]
Date[1]
Time[1]
Frequency[1]
Mode[1]
Comment[1]
and so on. We use this as a test protocol at my job. Now sometimes a user wants to copy the information from example row 1 to row 2, and then modify the text within the content controls on row 2.
Now to the problem. As the user copy pastes the entire row 1, the mapped content controls gets duplicated. When the user then modifies the information on row 2, the information on row 1 also gets changed (since they are mapped to the same xml nodes).
I have tried to work with the EditPaste function, to try avoid mapped content controls to be duplicated. Basically the function is: "IF the source we are copying is a mapped content Control, THEN just paste the information within the content control rather than the content control itself." This works pretty well when the user copies one cell (one content control) at a time, but it doesn't work when a whole row of 11 different content controls is pasted to another row.
Can someone give me some tips about how to get around this? Are there more sofisticated ways to do this?
Best regards, David