Hi Daniel,
As I said before I doesn't own the property, the property is inherited, is
already defined on a base class, I cannot modify this definition, so the
only keys I can use to the property are 'refine' and 'init'
---
Seldaiendil
2011/8/24 Daniel Lenggenhager <[email protected]>
> Hi Seldaiendil,
>
> I think you can use validate and check this with your own function.
>
>
> http://manual.qooxdoo.org/current/pages/core/defining_properties.html#validation-of-incoming-values
>
> apply should only be used, if the value has correct changed.
>
> Greez Daniel
>
> Am 24.08.2011 18:04, schrieb Seldaiendil D. Flourite:
>
> Hi,
>
> I'm trying to develop a widget inherited from qx.ui.control.DateChooser
> to not allow the user to select a pased date.
>
> So what I want is when setting property 'value' check it and if it's not
> in a range I want to cancel the process.
>
> I tryed with:
>
> // overwrited
> _applyValue: function(*value*, old, name) {
> if (*this*._validValue(*value*) {
> *this*.base(arguments);
> } else {
> *this*.setValue(old);
> }
> }
>
> Of course it was caotic, the event was fired twice, the _apply was called
> again if the value was invalid...
>
> So I have to do it another way, the only way I found is to catch the
> change of the value before it falls into _applyValue, in this.setValue. So
> I'm trying to overwriting setValue, but I know properties setters are
> overwrited on the fire the first time they are called so this.base will work
> only first time. The only way I found to do it is using directly the base
> class method.
>
> setValue: function() {
> // validate
> qx.ui.control.DateChooser.prototype.setValue.apply(this, arguments);
> }
>
> I found this terrible for programming! isn't there another way to just
> add a validation to an inherited property? Why I can't use
>
> properties: {
> value: {
> refine: true,
> validate: function() { ... }
> }
> }
>
> Playground <http://tinyurl.com/3qf33zv>
>
> ---
> Seldaiendil
>
>
> ------------------------------------------------------------------------------
> EMC VNX: the world's simplest storage, starting under $10K
> The only unified storage solution that offers unified management
> Up to 160% more powerful than alternatives and 25% more efficient.
> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>
>
>
> _______________________________________________
> qooxdoo-devel mailing
> [email protected]https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> EMC VNX: the world's simplest storage, starting under $10K
> The only unified storage solution that offers unified management
> Up to 160% more powerful than alternatives and 25% more efficient.
> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel