Revision history [back]

click to hide/show revision 1
initial version

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

cyiannoulis gravatar image cyiannoulis

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

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

Please help, Costas

click to hide/show revision 2
Further investigation

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

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

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