Skip to main content
1-Visitor
August 18, 2015
Solved

How to show/hide a custom widget based on a logic expression?

  • August 18, 2015
  • 1 reply
  • 2290 views

Hello! I am new to ThingWorx and have created a custom widget. I want to hide/show that widget depending on how an Expression evaluates. I have the widget imported and the expression tested, but i do not know how to hide/show the custom widget...could someone give me advice? Thanks in advance

    Best answer by hails.alex91@gm

    I do not think so, but i can get it...

    However, i figured it out! I used the Expression widget to compare a property field in one of my widgets. Then I had to change the output type from String to Boolean, and then drag that output on to my custom widget. It prompts me to bind with a property, and I chose Visibility...worked like a charm.

    Thanks for the help Pai!

    1 reply

    1-Visitor
    August 19, 2015

    Since each widget supports that feature, I would look at the code one of the existing widgets uses.

    On the server go to tomcat/webapps/thingworx/common/thingworx/widgets

    1-Visitor
    August 19, 2015

    Hello Pai,

    Thank you for the response! I am not sure how to view what you are suggesting...

    If I go to x.xx.xxx.xxx/tomcat/webapps/thingworx/common/thingworx/widgets, I get a 404 error. I have tried a few variations of teh address, but nothing seems to work. Any ideas?


    Thanks again for your help!

    1-Visitor
    August 19, 2015

    You'd have to be on the actual server itself to get to that information. Do you have actual access to the server.