Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只想在实例“addressDetails”存在时才调度一个动作(因为该实例是在子表单中加载的)。
我尝试使用 xf:action 的 'if' 属性如下,但没有奏效:
<xf:action ev:event="save" if="instance('addressDetails') != ''">
我收到错误“评估 XPath 表达式实例时出错('addressDetails')”。
有没有办法检查实例是否存在?
使用 XPath 2.0,只需编写:
exists(instance('addressDetails'))
或者你可以写:
count(instance('addressDetails')) > 0