Skip to main content
1-Visitor
January 8, 2017
Solved

How to load a media in imagelink from javascript ?

  • January 8, 2017
  • 3 replies
  • 2806 views

Hello

I would like to change an imagelink property  ("iconLight" ) in javascript code of a service

I have created two medias : lightOFF and lightON

I tried this directly but it does not work :

   if ( etatAllumage )

    { me.iconLight = "/Thingworx/MediaEntites/lightON" }

    else

    {me.iconLight = "/Thingworx/MediaEntites/lightOFF"}

Should I use a service to update the IMAGELINK property ?

thanks

Best answer by aduarte

Hello,

  Have you tried to put only your entity name?

   if ( etatAllumage )  

    { me.iconLight = "lightON" } 

    else  

    {me.iconLight = "lightOFF"}

3 replies

aduarte1-VisitorAnswer
1-Visitor
January 9, 2017

Hello,

  Have you tried to put only your entity name?

   if ( etatAllumage )  

    { me.iconLight = "lightON" } 

    else  

    {me.iconLight = "lightOFF"}

pjoly1-VisitorAuthor
1-Visitor
January 9, 2017

it works fine !

Thanks i was looking for too much complex things  😉

Regards

1-Visitor
January 9, 2017

I'm glad that it works