Am using a global template across many projects which needs to verify presence of client tags and create missing ones at runtime to avoid manual maintenance of projects.
I am having issues with propagating bindings for these newly created tags…if I change the tag after I have created one, it won’t update properly until I reload. Bindings that use the new tag do not propagate properly or at all
I know this stuff is way of the beaten track and may break on occasion with updates, but compared to rolling ones own module much easier.
I can create the tags easily enough.
eg
ntag=ProjectTag()
ntag.setName(tagName)
if dtype=="DateTime":
ntag.setAttribute(TagProp.FormatString, BasicTagValue("yyyy-MM-dd h:mm:ss aa"))
ntag.setTypeAndValue(DataType.DateTime,BasicTagValue(value))
I’m not sure if doing a ntag.startBinding(VisionClientContext, TagPath) is all that is required.
I cannot test as I have no idea of how to get hold of the VisionClientContext object required to test.
Is there are any docs or anyone that point one in the right direction it would be greatly appreciated…wading through the API classes and limited SDK docs leave one clueless as to how it all fits together properly.
Would all be solved if system.tag.addTag() could be generalized to include client tags.
-------- For those that are interested in what it is for and why one want to do this ----
It is for a global template menu system - see image. The top and left nav are actually instances of the same template
All menu items are templates on a template canvas loaded dynamically (eg menus can change to meet context). The templates even configure window sizing and scroll bar behaviour. In this image case the date defaults to today and is used across many windows and projects, hence the need for a client specific tag, which can easily be bound by components on any page. The beauty of this approach is that you can standardize this kind of selection task without the need for any session management apart from that exposed by the client tags. The user of the selected date tag can remain blissfully unaware of the init code etc required to manage the date. (this actual date defaults to start of day) which makes it super easy to generate historical charts.