-
Bug
-
Resolution: Fixed
-
Normal
-
6.0.1
-
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.