writeDataPoint in sever side scripting

Hi everyone

Is it possible, we can use writeDataPoint method in server side scripting ?


we have a section for questions in English.
In this post already been discussed this http://www.scadabr.com.br/?q=node/152
At the link below are examples of codes to use this component.
http://mango.serotoninsoftware.com/forum/posts/list/598.page # 2859
Examples in: dropdown, checkbox, etc..


Thank's for the replay.

But In my case no any image or textbox. My problem is just change virtual data point value true to false.

I hope you understand my problem.



Ok, but you really need to use server side script for this? There is a component called writing button, add it and choose the virtual datapoint. This will create a button. When you click it will change the value (true or false).
If you want to click on an image (a lamp) and image represent the datapoint_virtual is connected, use the example below:


Lamp image, clicking on it is setting/resetting a bit in variable 

  1. var s = "";  
  2. var mask =1024//1024 is bit 10, 8=bit 3  
  3. var arvo = "";  
  5. if (value & mask)  
  6. {  
  7.      arvo = value - mask;  
  8.      arvo = arvo +"";  
  9.      s += "<img style='cursor:pointer;' src='graphics/LightBulb/light_on.gif' onclick='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\","+ arvo+");return false;'/>";  
  10. }  
  11. else  
  12. {  
  13.      arvo = value + mask;  
  14.      arvo = arvo +"";  
  15.      s += "<img style='cursor:pointer;' src='graphics/LightBulb/light_off.gif' onclick='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\","+ arvo+");return true;'/>";  
  16. }  
  17. return s;  



You will need to adjust the command indicating the image path.
Fabio (kkkk by google translate)

first of sorry because i was not clearly give idea about my requirement. I have explain properly.

I was trying to delete datapoint history. diegoferreira was already help on them.He say that use this code.


var dpDao = new com.serotonin.mango.db.dao.DataPointDao();
var dpVo = dpDao.getDataPoint('<you dp xid>');
write this code in server side scripting. And this work successfully. But i was trying to add confirmation message before delete because of above code datapoint history is directly deleted and use may be create a mistake so for protection i am trying to generate confirmation popup message.
Infact , i was done this using html coding in server side scripting but problem is whenever refresh or login every time generate confirmation popup window so i was apply another trick. I was add one virtual datapoint and add one button(script) component. Using this component i was changed virtual datapoint value and whenever value is true execute server side script.
After delete datapoint value i was required to change virtual datapoint value to false so again datapoint value not deleted.
I hope using this message picture will be cleared in your mind. one more thing i am electronics engineers so may be i am not propely understand coding so please help me.