<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.此外,它还支持位于单独文件中的控件,并且每个控件都添加了use。
发布于 2013-08-26 13:41:02
ZK中的绑定与变量替换无关。@bind()并不意味着您可以使用${...}。这两个概念是完全独立的,即使在手册中两者都被称为"EL表达式“。但是结合EL表达式和ZUML EL表达式是两种不同的东西。
要允许在ivm中访问zscript,需要在脚本中的某个位置定义这个变量。一种方法是实例化它:
IVM ivm = new IVM();或者您可以使用自定义变量解析器。
https://stackoverflow.com/questions/18444321
复制相似问题