Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi everyone,
I am trying to access to the "Source URL" property of an image widget through a Thing service without success. Any idea on how to acomplish this?
I think it would be the same way to access to any widget property.
Greetings.
Josue, widget properties are generally locked down to the Mashup builder stage. You can't access them through services. What you can do is build services around them, and feed in those properties through your service output.
For example, the Image widget's SourceURL property requires a form of text input to select the right media entity, so you can bind a service that outputs text to it. Or you can bind a text box to the same property and type in the name of your existing media entity or maybe list the entire selection of media entities on a List widget and bind the selected rows here, so any time you select a row, the image would change.
Thanks Aanjan, your ideas might be helpful. I'll try them up and let you know if it worked for the purpouse Im looking to archive.
Aanjan,
I have implemented your ideas and they worked. Now I am facing another issue:
* Current implementation is for a set of 5 image widgets wich changes URL everytime an actions is performed (On/Off status); but I have developed a thing for each one of them. The issue is: Im I gonna have to create a thing for every one of a 1000 of image widgets we are planning to "control"?
If they are just Media Entities, you wouldn't require a Thing. The REST call 'http://localhost:8080/Thingworx/MediaEntities/' (assuming port 8080) will display the list of images you have. You can type the name of your entity after /MediaEntities/ to directly get to that image (http://localhost:8080/Thingworx/MediaEntities/AcknowledgeAlertIcon).
I thing I did not explained myself clear Aanjan:
I have an arrange of MediaEntites wich will be changing from Green to Red every time an action is performed (i.e. when a user is authenticated, one of thoose MediaEntities will go green and then, after few seconds will go Red).
What we will be developing is a "Dashboard" for the security area who will be monitoring access for many areas in an office/school, and I'm trying to figure out how to deal with this "control" functions.
Have you tried using State-based Formatting for this? As a simple test, try this -
Now you should see states like Available, Offline, Error as the states. Hit done and view your Mashup. If you type AVAILABLE into the textbox, you should automatically a green circle appear with the word AVAILABLE; same applies for other states like ERROR.
If this seems applicable to your use case, you can create a State Definition that would align more towards your design.
That was the solution I've been looking for. I really apreciate your time and support.
Gretting from Mexico