-1

code:

<zk>
    <vbox r="@ref(1)">
        <label value="${empty r}" />
        <label value="@load(empty r)" />
    </vbox>
</zk>

returns:

true
false

${} not working with @ref()?

1 Answers1

1

Short answer : no it doesn't.

First, if you want automatic updates of values use @load(...) because static expressions in ${...} are only evaluated once.

Second, bind annotations @init/@load are being computed later in the ZK Bind lifecycle than the static EL expressions.

So ZK first tries and evaluate your ${empty r}, at this time r is not defined so ${empty r} is null. Then later in the lifecycle it'll handle the databinding annotations @.

TheBakker
  • 2,852
  • 2
  • 28
  • 49