OK to use custom properties in Menu Tree or Tree perspective components?

I need to pass some data associated with individual leafs in the MenuTree and/or Tree Perspective components. I’m able to create my own custom properties and all appears to be functional, but I get this warning in Designer:

Obviously, the component can’t use my custom property, but will there be any future changes to these Perspective components that will break the function of using custom properties to pass data?

Thanks!

I would think that anything in the data dictionary for an item would be allowed, is your property in the data object or somewhere else?

In the instance I was listing, it is using a Menu Tree component, and they don’t have a generic “data” container that I could use for custom data. In the case of the Tree component that does have the data property, yes, I could use that.

Thoughts on the Menu Tree component? I tried using the “target” property, but that had adverse effects where with an OnClick event, the Menu Tree would trigger a navigate action using the data within the target property as the URL. Like I said, I can insert my own properties within the item object, which does function, but it may be a hack given the warning in Designer, where if Ignition began more strict data-model verification, my application would be broken.

1 Like

Would be good if there was a way to have that similar data property for each item in the menu tree as well. I have an application that I need to set a session property based on the menu Item you click and currently I just use the label. But it would be a bit cleaner if I could associate extra data to a menu item.

Also, just saw this already asked a year ago...

We won't. The type validation in Perspective is deliberately as defensive as possible, since it's all JSON 'under the hood', so there is no way to be stricter about it. If you're fine with ignoring warnings in the designer, there's basically 0% chance this validation will ever cause you any problems.

2 Likes

If the warnings start to pile up, then eventually it starts to cause some problems. Originally in the ad-hoc trends chart on the exchange, there was a bug that added an extra property to the Item dictionaries. This is small and ignorable, but when the page was loading several thousand tags, the amount of errors started to cause the page to really struggle. If you accidentally hovered over the warning triangle, than it would take ages trying to load thousands of error messages into the tooltip.

I am not sure if this is already fixed (This was earlier in 8, and I havent dealt with that project in a while), but if its still an issue than that would be the only problem with ignoring the warnings. @PGriffith if you look at this the bug was FB11246 and support ticket 105997, I never actually got a response that the bug was fixed so I am not sure.

That specific error/bug ticket is many thousands of logging messages hitting the system at the same time; the property validation in the designer shouldn’t be doing that, if I remember right.

1 Like