Bug in qx.ui.table.celleditor.AbstractField ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in qx.ui.table.celleditor.AbstractField ?

zaucker
Hi,

another unexpected behaviour (to me):

In the playground example below, if you edit one of the cells in the 1st
column and "erase" the value (with backspace) and then press ENTER, the
value is indeed removed (invisible). However, if you then edit the cell
again, it actually contains NaN (not a number).

I'd expect either NaN not to be hidden or, better, to actually have no value
at all (as if it was a null value).

I fixed the problem for myself with an "extension" derived from
qx.ui.table.celleditor.TextField with the following change:


-      if (typeof cellEditor.originalValue == "number") {
-        value = parseFloat(value);
-      }

+      if (typeof cellEditor.originalValue == "number") {
+          if (value != null) {
+               value = parseFloat(value);
+          }
+      }

Wouldn't that make sense in AbstractField?

Cheers,
Fritz

--
Oetiker+Partner AG tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bug in qx.ui.table.celleditor.AbstractField ?

Fabian Jakobs
Administrator
Fritz Zaucker schrieb:

> Hi,
>
> another unexpected behaviour (to me):
>
> In the playground example below, if you edit one of the cells in the 1st
> column and "erase" the value (with backspace) and then press ENTER, the
> value is indeed removed (invisible). However, if you then edit the cell
> again, it actually contains NaN (not a number).
>
> I'd expect either NaN not to be hidden or, better, to actually have no value
> at all (as if it was a null value).
>
> I fixed the problem for myself with an "extension" derived from
> qx.ui.table.celleditor.TextField with the following change:
>
>
> -      if (typeof cellEditor.originalValue == "number") {
> -        value = parseFloat(value);
> -      }
>
> +      if (typeof cellEditor.originalValue == "number") {
> +          if (value != null) {
> +               value = parseFloat(value);
> +          }
> +      }
>
> Wouldn't that make sense in AbstractField?
>  
Absolutely. Will you open a bug report for it?

Best Fabian



--
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-6784
[hidden email]

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bug in qx.ui.table.celleditor.AbstractField ?

fritz
Bug 3424

Cheers,
Fritz

On Mon, 8 Feb 2010, Fabian Jakobs wrote:

> Fritz Zaucker schrieb:
>> Hi,
>>
>> another unexpected behaviour (to me):
>>
>> In the playground example below, if you edit one of the cells in the 1st
>> column and "erase" the value (with backspace) and then press ENTER, the
>> value is indeed removed (invisible). However, if you then edit the cell
>> again, it actually contains NaN (not a number).
>>
>> I'd expect either NaN not to be hidden or, better, to actually have no value
>> at all (as if it was a null value).
>>
>> I fixed the problem for myself with an "extension" derived from
>> qx.ui.table.celleditor.TextField with the following change:
>>
>>
>> -      if (typeof cellEditor.originalValue == "number") {
>> -        value = parseFloat(value);
>> -      }
>>
>> +      if (typeof cellEditor.originalValue == "number") {
>> +          if (value != null) {
>> +               value = parseFloat(value);
>> +          }
>> +      }
>>
>> Wouldn't that make sense in AbstractField?
>>
> Absolutely. Will you open a bug report for it?
>
> Best Fabian
>
>
>
>

--
Oetiker+Partner AG tel: +41 62 775 99 03 (direct)
Fritz Zaucker                        +41 62 775 99 00 (switch board)
Aarweg 15                            +41 79 675 06 30 (mobile)
CH-4600 Olten                   fax: +41 62 775 99 05
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bug in qx.ui.table.celleditor.AbstractField ?

Fabian Jakobs
Administrator
thanks

> Bug 3424
>
> Cheers,
> Fritz
>
> On Mon, 8 Feb 2010, Fabian Jakobs wrote:
>
>  
>> Fritz Zaucker schrieb:
>>    
>>> Hi,
>>>
>>> another unexpected behaviour (to me):
>>>
>>> In the playground example below, if you edit one of the cells in the 1st
>>> column and "erase" the value (with backspace) and then press ENTER, the
>>> value is indeed removed (invisible). However, if you then edit the cell
>>> again, it actually contains NaN (not a number).
>>>
>>> I'd expect either NaN not to be hidden or, better, to actually have no value
>>> at all (as if it was a null value).
>>>
>>> I fixed the problem for myself with an "extension" derived from
>>> qx.ui.table.celleditor.TextField with the following change:
>>>
>>>
>>> -      if (typeof cellEditor.originalValue == "number") {
>>> -        value = parseFloat(value);
>>> -      }
>>>
>>> +      if (typeof cellEditor.originalValue == "number") {
>>> +          if (value != null) {
>>> +               value = parseFloat(value);
>>> +          }
>>> +      }
>>>
>>> Wouldn't that make sense in AbstractField?
>>>
>>>      
>> Absolutely. Will you open a bug report for it?
>>
>> Best Fabian
>>
>>
>>
>>
>>    
>
>  


--
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-6784
[hidden email]

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel