Dragsource, droptarget and valreps
Author: i.sharp@pcisystems.co.uk (Iain Sharp)
I am trying to create a drag and drop interface in my app. I set the dragsource valrep to ITEM=^glyph_a and the dragtarget valrep to ITEM=^glyph_a;=^glyph_b According to the documentation, using the Label property of the dragtarget allows me to use the second subfield in the data to specify a label. However, if I try to do this I get a valrep error. 0119 - Error on field FIELD - Illegal valrep value ITEM;Label The label does change, which indicates that it has found the subfield. How do I configure the valrep not to error? (I tried setting the valrep row to ITEM;* but this created a new row in the valrep of *.)
4 Comments
Local Administrator
Checking the reported issues shows Issue 19664 which seems similar yet different in that it talks about trying to validate the second subfield. The workaround is to turn $validation to limited for the system as a whole, I obviously don't want to do that.
Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Local Administrator
I haven't done this for a very long time, so I tried a few things. This works for me: I have painted a DragSource widget with an associated label: DataType: Image (any source) Interface: C* Initial Value: ITEM;Theo (; is GOLD ; ) In the Widget Properties I check the Source checkbox, and the Dynamic Label checkbox In the valrep I put Value ITEM and Representation ^I_OK I have painted a DropTarget widget with an associated label: DataType: Image (any source) Interface: C* Initial Value: no initial value In the Widget Properties I check the Target checkbox, and the Dynamic Label checkbox In the valrep I put in two lines Value blank and Representation ^FIND (blank is empty, no value, nothing) Value * and Representation ^I_OK (* is GOLD *) If I now compile and run I see in my Source the OK glyph with label Theo, and in my Target the Find glyph with no label. If I now drag my source to my target, my target gets the OK glyph and the label Theo Hope this is of use. Theo
Author: Theo Neeskens (tneeskens@itblockz.nl)
Local Administrator
All of that works for me as well, however, when I try and change occurrence, (The droptarget (and dragsource) are in multi occurrence entities) the validation fires and I can't leave the occurrence because bad valrep.
Author: Iain Sharp (i.sharp@pcisystems.co.uk)
Local Administrator
Hmm. I have tried it with multiple occurrences now and I still don't have a problem. But reading your original post again I see what might be the problem... The label goes in the value of the field, not in the valrep. The value of the field can be ITEM;label and the valrep for that needs to be ITEM=^GLYPH
Author: Theo Neeskens (tneeskens@itblockz.nl)