The following setup:

textfield.addListener("changeValue", this._onChangeValue, this);

_onChangeValue : function(e)
{
  var value = e.getData();
  if(value > 0)
  {
     ...
  }
  else
  {
     textfield.setValue(e.getOldData());
  }
}

The problem is it creates recursion. Look at the value changing in the 
textfield:

original: 3 -> normal in the function
type in: 0 -> function sets the textfield to the oldData 3, but the new oldData 
becomes 0!!!!
type in: -1 ->function sets the textfield to the oldData 0 and the infinite 
recursion started.

In this case there must be some way to not change the erroneous value to the 
oldData like it works here.

If I call a throw new Error("Error!"); then the oldData is NEVER set to the 
erroneous value!!! ...and it works!

I tried stop() which does not work and I can not see any other way except a 
dirty clotty way: having a variable this.__data to buffer.........but it is an 
unacceptable way.

Any other solution?

Stefan
                                          
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to