views:

40

answers:

2

Hi!

I'm looking to implement an XForms Color Picker/Selector/Control (you know where it shows boxes or shades of colors in a dropdown type control).

Is it possible to do this in XForms (without using Orbeon; I am using XSLTForms)? Is so, how is it implemented, or can anyone point me to (simple) code examples that do?

Thanks! :)

A: 

The best approach will depend on what XForms implementation you are using. If Orbeon Forms, I would create an XBL component that encapsulate the YUI color picker:

http://developer.yahoo.com/yui/colorpicker/

Alessandro Vernet
Unfortunately I am not using Orbeon (though I wish I could!) :( Currently, I am using the Firefox plugin, but I may be moving to use the XSLTForms for the app I'm building. Is there any other way?
developer
@iHeartGreek, the way you implement components is implementation dependent, so if you don't get an answer here, you might want to ask that question in the Mozilla XForms extension mailing list.
Alessandro Vernet
A: 

If you're using the Firefox plugin exclusively, then you can create new xform extension components by wrapping any combination of HTML, JavaScript, XForms and XUL widgets in XBL.

This is probably the best resource I've found for Mozilla XBL xforms extensions: https://developer.mozilla.org/en/XForms/Custom_Controls

In your case, probably the most efficient way to get this working would be to wrap the XUL colour picker component in XBL, ( https://developer.mozilla.org/en/XUL/colorpicker ) then write a little bit of JavaScript to link the picker's "onchange" event back to your model.

Erica