Skip to main content
1-Visitor
December 18, 2020
Solved

Image widget Image is not updating on mashup

  • December 18, 2020
  • 2 replies
  • 1838 views

Hi Team,

 

Have implemented one functionality in which I upload image via File Upload widget in repository and then display it immediately over image widget by creating media entity dynamically via service after clicking "Upload" button of file upload widget.

 

What actually happens it displays image correctly when I upload first time. It properly creates new media entity and displays over image widget immediately. But when I updates the image at the same time then it updates the image only at the media entity level but not refreshes on mashup.

 

Can somebody help me on this.

 

I am using code:-

 

var params = {
name: mediaEntityName /* STRING */,
content: imageContent /* IMAGE */
};

// no return
Resources["EntityServices"].UpdateMediaEntity(params);

 

My thingworx is 8.3.

 

Thanks in advance.

 

Best answer by Ashritha

-Upload Image using file upload widget

-Use Service :

var Content = Things["SystemRepository"].LoadImage({
path: undefined /* STRING */ 
});

path: complete path of image

 

-Use Value Display widget :

  1. Bind output of above service to value display
  2. Click on Render and State
  3. Change the Renderer to Image in the drop down
  4. Done and Save

2 replies

15-Moonstone
December 18, 2020

If more than 1 person access the mashup and uploads image at the same time then  UpdateMediaEntity shows same image for all. Instead use value display widget and use Load Image service.

ranjank1-VisitorAuthor
1-Visitor
December 18, 2020

@Ashritha 

I am the only user who is accessing the mashup.

 

Actually I had bound the source url dynamically to image widget. How can I replace it with Valuedisplay. Sorry can't figure out.

Could you please elaborate a bit more.

Ashritha15-MoonstoneAnswer
15-Moonstone
December 18, 2020

-Upload Image using file upload widget

-Use Service :

var Content = Things["SystemRepository"].LoadImage({
path: undefined /* STRING */ 
});

path: complete path of image

 

-Use Value Display widget :

  1. Bind output of above service to value display
  2. Click on Render and State
  3. Change the Renderer to Image in the drop down
  4. Done and Save
Community Manager
January 4, 2021

Hi @ranjank.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon