<textbox id="nextTitleTextbox" readonly="true" value="@bind(ivm.inventory.successorTitleName)" />
<button id="nextTitleButton" label="..." mold="trendy" onClick="@command('chooseFormerOrSuccessor', isFormer = false)"/>
<a id="nextTitleHrefView" href="/inventory_new.do?method=edit&docUID=${ivm.inventory.successorTitleName}">view</a>
<a id="nextTitleHrefHistory" href="javascript:showRenamingHistory(${ivm.inventory.successorTitleName},${ivm.inventory.successorTitleName})">history</a>
问题在于'a'标签。文本框和按钮工作正常,但“a”标记中的链接不会从绑定中捕获信息,因此链接看起来像/inventory_new.do?method=edit&docUID=
。我真的不明白这里有什么问题,因为我尝试了很多组合,类似的东西正在其他页面上工作。这种约束在哪里出错?
我甚至尝试从zscript
中输入字符串<zscript>
String successorTitleHref = "/inventory_new.do?method=edit&docUID=" + ivm.inventory.successorTitleName;
</zscript>
但是有例外:
Typed variable declaration : Class or variable not found: ivm.inventory.replacementTitleName.
此外,它支持的控件位于单独的文件中,每个控件都添加了使用derective。
答案 0 :(得分:1)
ZK中的绑定与变量替换无关。 @bind()
并不意味着您可以使用${...}
。这两个是完全独立的概念,即使它们在手册中都被称为“EL表达式”。但binding EL Expression和ZUML EL Expressions是两回事。
要允许访问ivm
中的zscript
,您需要在脚本中的某处定义此变量。一种方法是实例化它:
IVM ivm = new IVM();
或者您可以使用custom variable resolver。