Skip to main content
4-Participant
January 11, 2023
Solved

How to Change Value Display Widget When I Press the Button?

  • January 11, 2023
  • 2 replies
  • 4098 views

Hi, 

I want to change image of Value Display widget to toggle when I press the button.

For example, on the first screen, "check.png" image is shown, and "cancel.png" image is shown when I press the button.

And press the button again, "check.png" image is shown again.

Please tell me how to handle button click events in this situation.

 

Image is in the SystemRepository and get string path from get_check_image service in test_image Thing.

And pass the string path to LoadImage service in SystemRepository Thing.

 

 

Thanks in advance.

Jenny.

Best answer by Sathishkumar_C

Try to check the attached mashup... hope it will be helpful.

Here, i have used expression. Based on the expression output, execute the system repository service (LoadImage).

You can go with custom service as well. 

2 replies

17-Peridot
January 11, 2023

Try to check the attached mashup... hope it will be helpful.

Here, i have used expression. Based on the expression output, execute the system repository service (LoadImage).

You can go with custom service as well. 

Jenny,J4-ParticipantAuthor
4-Participant
January 12, 2023

Hi, Sathishkumar!

 

I analyzed your mashup and it works very well.
But it's a little different from my purpose.

I hope the file name is invisible, not use textfield widget.

I will trying to pass the String path without textfield.

 

Thank you for your answer.

Jenny.

17-Peridot
January 12, 2023

You can handle in multiple ways, i used "TextBox" for current image name. 

There are other possibilities,

  • another expression
  • event router
  • any thing property
  • custom service
1-Visitor
May 23, 2023

Have you resolved the problem? If you have, can you let me know?

 

Community Moderator
May 23, 2023

Hello SJ_10673050,

Thank you for using PTC Community!
The solution is already marked for this topic
This reply helped to solve the problem so please refer to it.

 

Hope this helps.

Regards,
Vivek N