0

Slider does not set decimal values (zk 7.0.2 & 7.0.3) [closed]

asked 2014-08-27 12:18:09 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

updated 2014-08-27 12:47:20 +0800

Hi guys,

I have a very annoying and urgent problem with the slider component. In my ViewModel the data is a Double number:

public Double getPotentialRisk() {
  return potentialRisk;
}

public void setPotentialRisk(Double potentialRisk) {
  this.potentialRisk = potentialRisk;
}

I have declared a slider like this:

<slider mode="decimal" maxpos="5.0" step="0.5" curpos="@bind(vm.potentialRisk)" />

When the page is initially loaded, the slider represents the correct decimal value (e.g 2.5) but after scrolling the slider, the returned value is always integer. Also, while i am scrolling, the tooltip shows the correct value (e.g 4.5) but after the value is updated the slider returns to the nearest int value (e.g. 4.0).

I am using ZK 7.0.2 and tested with ZK 7.0.3 eval

Even without data binding it seems that it is not possible to set the slider's position at a decimal place. Setting the value to "2.5" will set the slider at position "2.0".

I don't know whether it is a bug or i am missing something else.

Please help, Costas

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cyiannoulis
close date 2014-08-29 09:07:11

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-29 09:06:53 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

It has been confirmed as a bug http://tracker.zkoss.org/browse/ZK-2419

Unfortunately the workaround is not working. The slider does not work in 'decimal' mode at all. When you drag the handle (for example with step="0.5" and maxpos="5.0") the values are invalid. You cannot select for example the value 3.5. Only 3.4 and 3.6 are available.

Hope there will be a fix in the upcoming version 7.0.3

Thanks again Costas

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-08-27 12:18:09 +0800

Seen: 13 times

Last updated: Aug 29 '14

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