Laurent Donstetter schrieb:
Hi all,
Are there any documentation or examples about event handling, list of available event for each class... ? Basically I want a QSTextField to accept only int values, ie checking that only numbers are being typed in and that there is no overflow. Is there anything built-in to handle that or do I have to implement it myself with event listeners ?

You can use a QxSpinner instead. It does also support ranges for integer values.

Otherwise you need to implement it your own. Probably in a seperate class which you can contribute to the community?

I used to write it very simply in standard javascript with a keypress event handler returning false if last typed character was not a number or if it throwed an overflow exception... How can you do it with QooXdoo ?

In my opinion keypress is general a bad idea to handle this stuff because there are many actions like insert, cut, copy which you couldn't handle with this method. In qooxdoo you have a "input" event which is much more advanced than a simple keypress.

yourTextField.addEventListener("input", function(e) {
  this.setValue(parseInt(this.getRuntimeValue()));
});

Hope this helps.

Sebastian


Thanks,
Laurent.
Laurent Donstetter - SI-Factory
Téléphone : 06.70.68.37.63
Email : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
************************************************************************** Ce message et toutes les pièces jointes sont confidentiels et établis à l'attention exclusive de leurs destinataires.
Toute utilisation ou diffusion non autorisée est interdite.
Tout message électronique est susceptible d'altération.
Nous déclinons toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié.
Ce message et ses pièces jointes ne contiennent, a priori, pas de virus.
Il est de votre responsabilité de vous en assurer avant de les ouvrir.
------------------------------------------------------------------------------------------
This message and all attachments are confidential and intended solely for the recipients.
Any unauthorized use or dissemination is prohibited.
E-mail is susceptible to tampering.
We decline all responsability for the message if tampered, changed or falsified. We believe, but do not warrant, that this message and all attachments are virus free.
You should take full responsability for virus checking.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.12/265 - Release Date: 20/02/2006




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to