Comments: Validation and XUL

Here is example of my xbl binding for that purpose.

Posted by prefiks at December 10, 2005 1:11 AM

I'd use XForms. Of course, I don't know yet how to do that, and XULRunner doesn't ship with XForms, but I'd do it that way somehow.

Posted by Daniel Cater at December 10, 2005 3:17 PM

Um, this may seem rather simple, but why not just use xforms for validation of xul "forms"?
We've got the bindings for "embedding" xforms into xul.. and if something's not there that you want, you can skin any xforms element with whatever xul content you want via xbl. Please don't reinvent the wheel. thanks!
-woo

(From Alex: XForms support in Mozilla applications is not on by default at this point. That's the big reason why I'm not so impressed about that idea at first glance.

That said, where are these bindings? I'm willing to be convinced otherwise...)

Posted by woo at December 10, 2005 4:04 PM

this bug is tracking most of the work for the xul versions of the bindings. Apparently it's not checked in yet :(

https://bugzilla.mozilla.org/show_bug.cgi?id=307627

There are examples in the bug for "embedding" xforms in xul.

If you are unfamiliar with xforms in general, definite hit http://xformsinstitute.com/essentials/browse/book.php

Posted by woo at December 12, 2005 7:46 AM

The XForms extension for Firefox seems to be working fairly well - I think native XForms support will be included in the next major release.

Why not simply use the XForms Model module with XUL controls? The validation lies in the model, not the controls, and the XForms WG is encouraging people to use alternative UI's with the XForms models.

(From Alex: It's certainly a possibility.)

Posted by Daniel Schierbeck at December 20, 2005 10:02 AM

I think this would be the best approach:

<xforms:model>
  <xforms:instance>
    <data>
      <bar>
        <foo>Default</foo>
      </bar>
    </data>
  </xforms:instance>
  ... validation goes here ...
</xforms:model>
...
<label control="foo" value="Foo"/>
<textbox id="foo" ref="data/bar/foo"/>
Posted by Daniel Schierbeck at December 29, 2005 6:14 AM