4 Replies Latest reply on May 10, 2017 4:27 AM by carlesc RSS
    akesana Explorer

    how to manage image control  show and hide based on condition

    Hi,

     

    Can any one help to achieve this functionality.

     

    Thanks in advance.

      • Re: how to manage image control  show and hide based on condition
        polinao Collaborator

        What widget are you using as an image output?

        Here is some more information on the Expression widget (requires support login): https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS233996&lang=en_US

         

        and the Validator widget https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS250781&lang=en_US

          • Re: how to manage image control  show and hide based on condition
            akesana Explorer

            Thanks for you reply, sent links are not working.

             

            Please find below screen shot I have to show/hide image-473 based on value I get from service 1 or 0.

            if 1 show, if 0 hide like that

             

              • Re: how to manage image control  show and hide based on condition
                polinao Collaborator

                Please try this link, validator widget would be a perfect solution for you:   https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS250781&lang=en_US

                 

                • The Validator Widget is an invisible widget that is used to perform operations on data currently entered in the Mashup
                • The Validator Widget is a simple version of the Expression widget as its OutputBaseType is set to Boolean
                  • For detailed description of Expression widget, please refer to CS233996
                • The Validator Widget has True and False Events and can be used to trigger other services, which is easier to use than the Data Changed event in Expression widget
                Using the Widget:
                • Define parameters / input bind points
                  • When using the Validator widget, there needs to be a way to bring in the data from external fields / services / etc.
                  • Select the Validator Widget and click the Configure Validator button (gear icon) in the top right corner of the Widget Properties pane to bring up the Configure Widget dialog.
                  • Use the Add Parameter button to create all necessary parameters to the widget.
                    • Each parameter requires a name, which can be used in your expression.
                    • BaseType specifies the allowed data type that can be bound to the parameter.
                  • After defining all parameters and clicking the Done button, the new parameters appear as bind points in the properties list for the Widget.
                • Define the expression
                  • Expressions support all JavaScript comparison operators.
                  • For simple comparison expressions, the if() else() would not be needed
                    • If the input is Boolean type, "input" can be put directly in the expression field
                    • If the input is numeric type, "input ==1" can be put directly in the expression field
                • Evaluate the expression
                  • The Expression widget is triggered by the Evaluate widget event.
                  • There is a AutoEvaluate checkbox, and the evaluate the expression when input is changed
                  • This event can be bound to a button widget's Clicked event, or as part of an input field widget's Changed event.
                • Returning result
                  • The result of Validator widget is a Boolean type, it can be used to disable or control the visibility of other widgets
                  • The True and False event can be used to trigger other services or events like Navigate, Execute or Refresh
            • Re: how to manage image control  show and hide based on condition
              carlesc Ninja

              Think of ValueDisplay widget which can show Images and has StateBased formatting