-
Bug
-
Resolution: Fixed
-
Major
-
8.0.5, 8.6.1
-
Security Level: Jimmy
-
ZK 8.6.2 S1
-
None
Steps to Reproduce
run the attached example
Current Result
the each expression at the bottom resolves to the last value of the list model
Expected Result
each should resolved to null
Debug Info
Root Cause
ForEachRenderer is adding a variable resolver to the current execution in each iteration
https://github.com/zkoss/zkcml/blob/v8.6.1/zuti/src/org/zkoss/zuti/zul/ForEachRenderer.java#L64
But doesn't clean it up.
A template defined in a zul page uses TemplateImpl which does the clean up by default, but also adds the VariableResolver.
(adds the same variable resolver again)
https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/impl/UiEngineImpl.java#L2307
(removes it)
https://github.com/zkoss/zk/blob/v8.6.1/zk/src/org/zkoss/zk/ui/impl/UiEngineImpl.java#L2341
Workaround
manually remove the variable resolver during template.create
(commented out in the attachment)