cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Image widget Image is not updating on mashup

ranjank
15-Moonstone

Image widget Image is not updating on mashup

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.

 

ACCEPTED SOLUTION

Accepted Solutions
Ashritha
15-Moonstone
(To:ranjank)

-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

View solution in original post

4 REPLIES 4
Ashritha
15-Moonstone
(To:ranjank)

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.

ranjank
15-Moonstone
(To:Ashritha)

@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.

Ashritha
15-Moonstone
(To:ranjank)

-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
slangley
23-Emerald II
(To:ranjank)

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

Announcements


Top Tags