Skip to main content
1-Visitor
February 24, 2020
Question

Write an external data with Java

  • February 24, 2020
  • 1 reply
  • 1158 views

Hi,

 Could anyone tell me how I can write a service with java? It is a simply bool value (true, false) and I found it, but it is not working:

 

$scope.app.mdl.Avtis_BudapestThing.svc.SetAnimation.data = 'true';

 

SetAnimation is the name of the service. If I use a button "click" action then it is working, but I want to write it automatically after some seconds with java.

 

Many Thanks

BJ

 

 

1 reply

21-Topaz I
February 25, 2020

Hi @Janos1987 ,

I belive you meant js - code. If yes , then the js code should be some thing like this:

 

 
 twx.app.fn.triggerDataService('BudapestThing','SetAnimation',"{data:{\"prop\":true}}")

 

Where 'BudapestThing' is the name of the Thing which defines the service

'SetAnimation' is the service

and true is the value

here 'prop' is the name of the service argument  e.g. iin the definition of the service:

 

2020-02-25_10-55-44.jpg

 

Here in the example below the code if we want to call the service according to the defintion shown in  the the picture above :

 

twx.app.fn.triggerDataService('TestTing-rray','setBoolProp',"{data:{\"prop\":true}}")

 

 

Janos19871-VisitorAuthor
1-Visitor
March 4, 2020

Thank you for your answer, I need more time to test it and give back a detailed report about it.

 

Please be patient.

Janos