0

DoubleSpinner's ClassCastException on value get

asked 2011-06-24 08:27:18 +0800

Evilsun gravatar image Evilsun
27

Hi ,
I have doublespinner component defined in zul :

<doublespinner id="tbSpamThreshold" mold="rounded" constraint="no negative, min 0.00, max 1.00"/>

and entering numbers such 0.01 , 0.03 , etc , then i trying to get it's value in controller ( tbSpamThreshold.getValue() ) it fails with :

SEVERE: >>java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double
>> at org.zkoss.zul.Doublespinner.coerceFromString(Doublespinner.java:133)
>> at org.zkoss.zul.impl.InputElement.setText(InputElement.java:270)
>> at org.zkoss.zul.impl.InputElement.checkUserError(InputElement.java:639)
>> at org.zkoss.zul.impl.InputElement.getTargetValue(InputElement.java:478)
>> at org.zkoss.zul.Doublespinner.getValue(Doublespinner.java:60)

Is such behaviour can be fixed somehow or this is a bug ?

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-06-24 15:07:05 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

I would call it a bug... even if you're entering a 1 into the doublespinner and retrieve #getValue() or #doubleValue(), it throws the ClassCastException.

Please file a bug report.

Cheers, Maik

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-06-24 08:27:18 +0800

Seen: 264 times

Last updated: Jun 24 '11

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