In order to load the image in a mashup, you need to use the value display widget and the LoadImage service from the file repository. Here are some steps for a very basic version:
- Create a new mashup with a vertical layout that has one row and a header
- In the header, put a text box and a button
- Import the LoadImage service from your file repository
- Bind the text box "Text" field to the "path" parameter
- Bind the click event of the button to call that service
- In the row, drag and drop a value display widget
- Drag "Content" from "AllData" of the LoadImage service to the value display widget
- View the mashup and type the path to the image file and click the button.
Here is what mine looks like:
I hope this helps!
I have a image file Flag.jpg at location. C:\ThingworxStorage\repository (I assume its Thingworx repository)
I followed the steps mentioned in above post & created Mashup. But when type /Flag.jpg in as image path and click button, image did not get displayed.
This my connections in composer.
Am I missing something?
Mithun, I believe it's not working in your case because you've chosen a dynamic service from the FileRepository Template itself (it doesn't know which repository to go to). You would need to either give it your repository name or select your repository directly (for example SystemRepository).
Try moving your image into SystemRepository (ThingworxStorage\repository\SystemRepository) and then use the LoadImage service on SystemRepository.
Thanks Ravi, it works
I have a question here
Is this SystemRepository path (C:\ThingworxStorage\repository\SystemRepository) is fixed?
What I am trying to achieve here is
1. I am using .Net SDK
2. I am create Thing there and one of its service create an image from xps doc & saved at certain location.
3. This service also returns the saved image path.
4. I have to display this image in Thingworx mashup by connecting to thing created in .Net code.
5. I could able to connect the Thing (by creating remote thing in TWX and binding it) but from from image path i could not able to display image on Mashup.
6. What I am planning here is, if this SystemRepository path is fixed then will saved the image at SystemRepository location & display it on mashup using LoadImage service on SystemRepository.
I am new to Thingworx and I am not sure I am doing it in right way or not.
Can something similar be done with rich text file content? Is there a widget that displays rich text?
I followed Tori's instructions but used LoadText in place of LoadImage and a TextArea widget in place of the ValueDisplay widget. The logic works but what is displayed is not the nicely formatted text but the raw contents of the rtf file ...