Hey Goetz,

2009/2/20 Goetz Babin-Ebell <[email protected]>:
> Hello,
>
> I'm a little bit confused about the change in revision 1.2 of
> src/Wt/WLineEdit.C:
>
> Index: src/Wt/WLineEdit.C
> ===================================================================
> RCS file: /opt/cvs/wt/src/Wt/WLineEdit.C,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- src/Wt/WLineEdit.C  15 Jul 2008 06:25:49 -0000      1.1
> +++ src/Wt/WLineEdit.C  28 Jan 2009 20:11:14 -0000      1.2
> @@ -39,6 +39,8 @@
>     content_ = text;
>     flags_.set(BIT_CONTENT_CHANGED);
>     repaint(RepaintPropertyIEMobile);
> +
> +    setStyleClass(validate() == WValidator::Valid ? "" : "Wt-invalid");
>   }
>  }
>
> The only note in the Changelog that might cause this is
>  * fix bug causing mouseup being called twice at end of drag (for
>   example confused mandlebrot example)

Oops, this change slipped through the Changelog, and yes, is a bit intrusive...
This change is intended to set an invalid style to inputs that do not
validate().

> This change requires me on every change of the content of the WLineEdit
> to first fetch the old style, make my change and reset the old style.

Do you use a validator on the affected WLineEdit ?

If not, we can easily make sure your current behavior is not affected.

> Is there some greater meaning that I simply don't grasp ?

The whole idea is that now that all built-in validators have
javascript implementations that allow instant feedback. For
consistency, we want to do this for also for server-side changes.

This feedback is reflected by setting or removing a style class. The
caveat currently, which you hit, is that it assumes that you do not
set any other style class on a form widget (we might relax this at
some point in the future when we support adding and removing a style
class, rather than only being able to set all style classes).

Regards,
koen

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to