On 1/12/06, Alvin Wang <[EMAIL PROTECTED]> wrote:
>
> I have been working on enhancements to datacontroller.
Definitely a good thing. datacontroller is pretty raw right now.
> If each widget had the ID="inf_${widget.name}" attribute added to it, I
> am pretty sure that the widget attr clause could be used to pass in the
> javascript call.
Adding an ID attribute seems reasonable. Validation gets more complex
for more complex widgets, but the really complex ones probably know
how to validate themselves.
> I would also need
> onsubmit="return validateOnSubmit()" on the form tag. I think I can
> pass that into the form widget.
>
> I guess the question would be if I should create my own set of widgets
> or should this be included in the standard widgets.
An idea that has been bandied about that I think would be really cool
would be to extend FormEncode validators to include a JavaScript
reference of some kind. That can then be pulled out and put on the
page to validate the widgets... the plus to this approach is that you
set an Int validator on a field and get both client side and server
side validation with no other work. It seems quite doable, but I
haven't considered all of the mechanics involved.
Kevin