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

Save into a deep form bean fires improper NotifyChange

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.0.2
    • 6.0.1
    • Databind 2
    • None

      Works fine if the form bean is one level deep (the textbox is disabled):
      <div apply="org.zkoss.bind.BindComposer"
      viewModel="@id('vm') @init('my.Model')"
      form="@id('fx') @load(vm.data) @save(vm.data, before='save')">
      <checkbox checked="@bind(fx.flag)" />
      <textbox disabled="@load(fx.flag)" />
      </div>

      Does not work if the form bean is two levels deep (the textbox's state is unchanged):
      <div apply="org.zkoss.bind.BindComposer"
      viewModel="@id('vm') @init('my.Model')"
      form="@id('fx') @load(vm.data) @save(vm.data, before='save')">
      <checkbox checked="@bind(fx.something.flag)" />
      <textbox disabled="@load(fx.something.flag)" />
      </div>

      From my debugging it comes out that the problem is here:
      BindELResolver.tieValue(ELContext elCtx, Object base, Object propName, Object value, boolean allownotify)
      line 170: BindELContext.addNotifys(base, (String) propName, value, bctx);
      For the second example (not working), the propName = "flag", but should be "something.flag" (equal to the value of the 'script' variable). If I change under debugger the propName to "something.flag", then the textbox's disabled status is toggled correctly.

            dennis dennis
            hattifnat hattifnat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: