Problem with Button(Write) on Graphical View


#1

Hi i recently experience a problem with the graphical view on ScadaBR when i want to put a button to write data changing a data point from true to false  the button only detects inputs point not output points how i can change this or how cand do this with a simple script, another question why when i want to return a value from a script ScadaBr give me a error of transform binary to binary or numeric to numeric


#2

No problem,

Use a Server Side Script - I.E

###On Off Button
var s = "";  
if (value)  
    s += "<img style='cursor:pointer;' src='graphics/Botao-3D/botao20.png' onclick='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", \"false\");return false;'/>";  
else  
    s += "<img src='graphics/Botao-3D/botao10.png'  onclick='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", \"true\");return false;'/>";  
return s;  
 
Regards,

#3

Hello, is it possible to set a Data Point from a Graphical View without having said point in the view? I saw you asked this same question in the IAS forums here, but didn’t get a definitive answer.

I know this is an old thread, I was trying to send you a PM but apparently I can’t do that yet. My apologies if this is not the place to do this.

Anyway I’ll appreciate your help, thanks.


#4

Hey Jojoto,

Currently, no - and that is for security reasons. You’d not want for users to have access through JS on sensible datapoints without going through the proper process (for auditing purposes).

But you can do it by invoking the java classes on ScadaBR. Java classes are accessible from the JS execution context. There are some example here in the forum on how to instantiate and use them, but you’ll need some knowledge on the Java classes and architecture.

ScadaLTS has set a sandbox to avoid this behavior, also to improve security.

What I’d recommend is - use the proper UI components - or - develop your components to ensure a balance of security and function.

Hope this helps