0

Doublebox with format fails at the client side if typed number < 1.0E-6 [closed]

asked 2013-04-25 10:49:06 +0800

cvarona gravatar image cvarona
554 1 6

The error appears when I apply the format #,##0.00000000000; just try the following in the online zk sandbox:

<window title="My First Window" border="normal" width="200px">
    <doublebox onChange='alert( "onChange" );'  width="150px" />
    <doublebox format="#,##0.00000000000" onChange='alert( "onChange" );'  width="150px" />
    <decimalbox format="#,##0.00000000000" onChange='alert( "onChange" );' width="150px"  />
</window>

The first input field is a doublebox with no format; it will do ok. A decimal box displaying the aforementioned format will also do ok; the formatted doublebox won't trigger the onChange event if numbers lower than 1.0E-6 are typed; the js console will show

Időbélyeg: 25/04/2013 11:33:20
Hiba: ReferenceError: varStr is not defined
Forrásfájl: http://www.zkoss.org/zksandbox/macros/zksandbox.js.dsp;jsessionid=57D671ABCEE63B310D5886DFAEAFDA7F.zktest?v=2013032614
Sor: 6

I've copied this error from my ff console, but it fails on ie the same way.

If I try this with <debug-js>true</debug-js> it will fail on this line

var nind = (indVal < 0 ? varStr.length : indVal) + shift;

I'm using FF 20.01, IE9 and zk 6.5.2.

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cvarona
close date 2013-05-09 07:27:50

2 Answers

Sort by » oldest newest most voted
1

answered 2013-04-25 12:20:58 +0800

cvarona gravatar image cvarona
554 1 6

I've reported it as a bug: http://tracker.zkoss.org/browse/ZK-1737

With kind regards

César Varona

link publish delete flag offensive edit

Comments

thanks a lot

noahhuang ( 2013-05-06 04:04:42 +0800 )edit
0

answered 2013-04-25 11:02:08 +0800

cvarona gravatar image cvarona
554 1 6

updated 2013-04-25 11:02:35 +0800

After debugging a little I think it must be a typo, for a few lines above the following declarations are to be seen:

var pureFmtStr = efmt.pureFmtStr,
    ind = efmt.purejdot,
    fixed = ind >= 0 ? pureFmtStr.length - ind - 1 : 0,
    valStr = (val + '').replace(/[^e\-0123456789.]/g, '').substring(val < 0 ? 1 : 0), ...

in other words,

var nind = (indVal < 0 ? varStr.length : indVal) + shift;

should read

var nind = (indVal < 0 ? valStr.length : indVal) + shift;
link publish delete flag offensive edit

Question tools

Follow
2 followers

RSS

Stats

Asked: 2013-04-25 10:49:06 +0800

Seen: 12 times

Last updated: Apr 25 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More