Hi Thi!

Why do you need this:
QxWidget.flushGlobalQueues();

Makes IMHO no sense.

If "match" is really null this is an invalid value. You should normalize 
it to a empty string.

textfields are always selectable by default. So there is no need to 
manually do: valueField.setSelectable(true)

The drag and drop in select fields does not work, because we need to 
prohibit the default drag and drop handling to be sure that qooxdoo's 
built-in drag&drop handling work stable.

Hope this helps.

Sebastian


Thi Nguyen schrieb:
> Hi,
>  
> I am trying to create a text field that only takes numeric by using a 
> regular expression to replace anything that is not a digit with null. 
> The regular expression works. However, the QxTextFiled.setValue() does 
> not seem to worl all the way.
>  
> 1. If the value entered is 1a2 then the value being displayed is "12". 
> However, if the value is "abc" then the display value is "abc" 
> eventhough "match" is null.
>  
> 2. Also, with "valueField.setSelectable(true)", I can select a text 
> field with double click but can not just drag and select.
>  
> Please help me to see what I have done wrong. Here is the codesnipets.
>  
> Thank you very much in advance.
>  
>  
> var valueField = null;
> valueField = new QxTextField(value);
>  valueField.setSelectable(true);
>            
>  valueField.addEventListener("input", function(e) {
>                             
>      var re = /[^\d]/g        
>       var text = e.getData();
>       var match = text.replace(re,"");
>                               
>        valueField.setValue(match);
>        QxWidget.flushGlobalQueues();
>                          
>     }, this );
>  
> th_java
> 
>  
> 
> ------------------------------------------------------------------------
> On Yahoo!7
> 360°: Your own space to share what you want with who you want! 
> <http://au.rd.yahoo.com/mail/tag/**http%3A%2F%2Fau.360.yahoo.com%2F>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to