Skip to main content
4-Participant
Jan 11, 2023 6:09 AM UTC
Solved

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

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.

17-Peridot
Jan 11, 2023 7:14 AM UTC

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. 

6 replies

17-Peridot
Jan 11, 2023 7:14 AM UTC

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. 

Translate
Jenny,J4-ParticipantAuthor
4-Participant
Jan 12, 2023 1:16 AM UTC

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.

Translate
17-Peridot
Jan 12, 2023 5:47 AM UTC

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
Translate
1-Visitor
May 23, 2023 2:54 AM UTC

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

 

Translate
Community Moderator
May 23, 2023 3:33 AM UTC

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

Translate