Hi, all.
I'm trying to do a tag filter in my Tag Browse Tree with Historical Tags. I'm using the filterTag function. I saw many forum entries but I can't resolve this. Even if I only script return False, the Tag Browse Tree shows me all the tags. I can't print for debug, neither.
Is there something too wrong that I'm not seeing? How to use thefilterTag function correctly?
Thanks to all.
I don't know how your code is structured, or what you are using to filter, but any property should work. Take this sample tag browser for example:
If I filter on tag name using the text field, here is the result when I type "Test" into the box:
This is the code used in the filterTag extension function:
def filterTag(self, tag):
if self.parent.getComponent('Text Field').text in tag.name:
return True
else:
return False
What you are probably missing is the refresh() method. To get the above effect, I have the following script on my text field's keyReleased event handler:
Justin, thanks for so complete answer!
Yeah, by one side, I had a wrong configuration in the Tag Browse Tree that I already fixed it.
And now, by the other side, I see that I have more subdirectories than you in your example.
I mean: I have within default, plc and UPS folders, for example. And within plc other subdirectories ordered by sector.
Is this possible to be filtered?
I am so sorry for my horrible english.