cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

how to manage image control show and hide based on condition

akesana
1-Newbie

how to manage image control show and hide based on condition

Hi,

Can any one help to achieve this functionality.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
posipova
20-Turquoise
(To:akesana)

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

View solution in original post

4 REPLIES 4
posipova
20-Turquoise
(To:akesana)

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

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

posipova
20-Turquoise
(To:akesana)

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

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

Top Tags