Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello,
I am building a mashup where I would like to display an image every time a condition is successfully complete.
As an example:
If a = '1' then
If a = '2' then
If a = '3 then
etc
I am currently playing with the 'Visible' attribute and the 'expression widget but I would like to know if there is any other way to do it more dynamic. The reason for this is that I am using many different pictures and expressions so it would be a mess if I add like 80 pictures on top of each other plus all the expressions that are related to them.
Thanks in advance for any help on this!
Hi Santiago Aguiar,
I am not sure if I understand your query completely.
You may try to save the images as properties in some thing and load the image in the Mashup based on your condition to a widget.
So, you would need a single widget for loading the image when the conditions changes.
Dear Santiago,
Please consider to do it like this:
1. create a DataTable to log down the ID(basetype with INTEGER or STRING) and the image(with basetype of IMAGE) that you will show in your mashup
2. create a service in your Thing: INPUT: ID(same basetype to your DataTable ID), OUTPUT:IMAGE; in your script fetching the image field from DataTable
per the given ID number.
3. in your mashup builder, bind the service created in step 2, and add a textbox or any other widget which will input a number(or from other data resource per your business logic), and then pass this number to the service as an input, and then bind the returned IMAGE data from the service to IMAGE widget in your mashup.Remember to bind the Changed event in the textbox to the service to make sure every time the value in textbox changed you update the image.
Hope this helps,
Br,
Anna