Custom List is destoyed after placement from stencil [SOLVED]

Started by Hellboy, May 04, 2018, 12:54:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hellboy

Hi,
I`ve created a list on a worksheet and put it on a stencil. After this, I dragged it from a stencil to a worksheet and it became a simple group.
What`s wrong? Should I create it in a stencil?

Yacine

The master in the stencil must always be one object (either single shape or a group of shapes).
If you really need individual shapes, you can ungroup the shape (automatically or manually) on drop.
Yacine

Hellboy

Quote from: Yacine on May 04, 2018, 03:18:38 PM
The master in the stencil must always be one object (either single shape or a group of shapes).
If you really need individual shapes, you can ungroup the shape (automatically or manually) on drop.
Yes, I created a group first and made a list after (I looked at some standard list as an example).

Yacine

Yacine


Yacine

As suspected: the list is not a single object.
1. Write a macro as described here: http://visguy.com/vgforum/index.php?topic=26.0
1. Group the list
2. Add the according CALLTHIS function in the ONDROP event cell
3. now you can drop the grouped list in your stencil, it will ungroup when you drag it back into your drawing.

Cheers,Y.
Yacine

Nikolay

+1.. Master can be a single shape only (i.e. either a shape, o a grouped shape). You cannot have list as a master shape directly.

Hellboy

Ok, I've deleted all list items, put an empty list on a stencil and returned it back to a worksheet, everything is ok, it is a list, not a simple group.
I can drag my ListItem shape to it and populate my list. But I want to use EventDrop functionality...
So, I try to use:
User.msvSDListItemMaster = USE("ListItem")
Events.EventDrop = IF(LISTMEMBERCOUNT()=0,DOCMD(2270),0)
to trigger insertion of my "ListItem" into the list.
But it is doesn`t work. My list item is on a stencil and has name "ListItem". What`s the problem?

Nikolay


Hellboy

Thank you, Nikolay for your simplest example. I compared your list and mine and found out that the problem was in the following:
Name of my ItemList was horItemList and even after renaming, it has an old name.
Then I deleted it from a stencil and inserted it in a stencil one more time. After this everything is OK.
I think it is a bug.
Many thanks to Nikolay and Yacine for help and Microsoft for a bug :)

Hellboy

RESUME
1. Delete all list items before list placement to the stencil (leave header shape if it is not an item of a list).
2 (optional). Add two rows to a list`s ShapeSheet to automate the population of the new list after placement on a worksheet:
User.msvSDListItemMaster = USE("ListItem")
Events.EventDrop = IF(LISTMEMBERCOUNT()=0,DOCMD(2270),0)

vojo

to your amusement, 2003 didn't have this problem (did this lots of times)
I guess I can add it to the "101 things 2003 did better than 2013"  ;-0  ;-)

Nikolay

Hmm.. But Visio 2003 does not have lists?
From the other side, since it does not have lists, it does not have any problems with them :)

vojo

you can make them with props fields and actions.
So technically, yes not identical 2003 but 2003 you can even make lists that spawn other lists...and all can be stored in stencil