-
Bug
-
Resolution: Fixed
-
Normal
-
7.0.2
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
- run the zul
<div apply="org.zkoss.bind.BindComposer" viewModel="@id('vm')@init('support.component.SliderDoubleVM')"> <slider mode="decimal" maxpos="5.0" step="0.5" curpos="@bind(vm.potentialRisk)" /> <label value="@load(vm.potentialRisk)"></label> </div>
- drag slider to decimal value like 3.5, 4.5
Actual Result
The output value is always integer.
Actual Result
The output value is double.
Workaround
Bind with curposInDouble
<slider mode="decimal" maxpos="5.0" step="0.5" curposInDouble="@save(vm.potentialRisk)" curpos="@load(vm.potentialRisk)" />
<?xml version="1.0" encoding="UTF-8"?> <language-addon> <!-- The name of this addon. It must be unique --> <addon-name>zkbind</addon-name> <!-- Specifies what other addon this depends --> <depends>zul</depends> <!-- Which language this addon will be added to --> <language-name>xul/html</language-name> <component> <component-name>slider</component-name> <extends>slider</extends> <annotation> <annotation-name>ZKBIND</annotation-name> <property-name>curposInDouble</property-name> <attribute> <attribute-name>ACCESS</attribute-name> <attribute-value>save</attribute-value> </attribute> <attribute> <attribute-name>SAVE_EVENT</attribute-name> <attribute-value>onScroll</attribute-value> </attribute> </annotation> </component> </language-addon>
Debug Information
getCurpos() returns int, so binder always sets integer value to ViewModel. Maybe provide another getCurpos() that returns double, but I'm don't know how EL can tell which method to call.