YUI interface with FormFaces
Input:
// enter global scripts here
({
"external" : null,
"rgbChange" : function(o) {
var model = this.bind.model;
var vertex = model.graph.getVertex(this.bind.defaultBinding.getBoundNodes()[0], "text");
vertex.setValue(o.newValue.toString());
if (!model.hasChanged()) {
return;
}
XmlEvent.dispatch(model.htmlNode, "xforms-recalculate");
XmlEvent.dispatch(model.htmlNode, "xforms-revalidate");
XmlEvent.dispatch(model.htmlNode, "xforms-refresh");
},
"xblBindingAttached": function() {
var cpicker = this.shadowTree.getElementById('cpicker');
this.boundElement.picker = new YAHOO.widget.ColorPicker(cpicker, {
showhsvcontrols: true,
showhexcontrols: true,
images: {
PICKER_THUMB: "assets/picker_thumb.png",
HUE_THUMB: "assets/hue_thumb.png"
}
});
this.boundElement.picker.on("rgbChange", hitch(this.boundElement,this.rgbChange));
}
})