Here is a simple solution to this...
This isnt how I ended up implementing it but I'm sure most people won't want to modify the DB so you could do it this way very easily.
First in the javascript tag on the views.jsp page you can add
var TOGGLE = 0;
var SET_TRUE = 1;
var SET_FALSE = 2;
var buttonType=TOGGLE;
function getCurrentValue(divId){
var theDiv = $(divId);
var temp = null;
var inputElems = theDiv.getElementsByTagName("input");
for (var i=0; i<inputElems.length; i++) {
if (inputElems*.id.startsWith("txtChange")) {
temp = inputElems*.value;
}
}
return temp;
}
function buttonController(pointId, pointType, setable, pointViewId){
var divId = "c"+pointViewId+"Change";
if(pointType==1 && setable){
if (buttonType==TOGGLE) {
mango.view.setPoint(pointId, pointViewId, getCurrentValue(divId)>0?0:1);
} else if (buttonType==SET_TRUE) {
mango.view.setPoint(pointId, pointViewId, 1);
} else if (buttonType==SET_FALSE) {
mango.view.setPoint(pointId, pointViewId, 0);
}
}
}
then in the div with ```
id="c${pv.id}"
add a onmousedown event handler like this
onmousedown="buttonController(${pv.dataPoint.id},${pv.dataPoint.pointLocator.dataTypeId},${pv.dataPoint.pointLocator.settable},${pv.id});"
Thats it.. you can now click on the image to change its value! :-)
you can set the mode in the javascript to toggle, set true, set false, of course you which ever way you choose it will act the same for all...
The script also only allow action on binary type datapoints.
Maybe its usefull for someone who knows.. :-D