Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1062

In ZK6 when saving binded SimpleForm to bean, null intbox give a 0 value to Long bean property instead of null value

XMLWordPrintable

      We are using zk6 MVVM binding to validate and save a form.
      In OurVM we have:
      ...
      private Form fx = new SimpleForm();
      private OurBeanClass selected;
      ...
      (setters and getters and other methods)

      In our zul file:
      <window form="@id('fx') @init(vm.fx) @load(vm.selected) @save(vm.selected, before='updateMetadata')"
      apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('our.package.vm.OurVM')"
      validationMessages="@id('vmsgs')" >
      ...
      <button label="Save" onClick="@command('updateMetadata')" disabled="@load(not fxStatus.dirty)"/>
      ...
      <intbox id="ourintbox" value="@bind(fx.ourLongProperty)"/>
      ...

      In OurBeanClass the ourLongProperty it's a Long. When we save our form if the intbox "ourintbox" is empty the binding mechanism saves in ourLongProperty a 0 value instead of null.

            dennis dennis
            nicodom nicodom
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: