我有一个奇怪的bug,可以复制,但我找不出是什么原因导致的。
如果我调用这个xpage,我会得到以下错误消息:
执行JavaScript计算表达式时出错
未找到“fieldname”
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoDocument var="Request"></xp:dominoDocument>
</xp:this.data>
<xp:repeat rows="999" var="fieldname">
<xp:this.value><![CDATA[#{javascript:"myfieldname"}]]></xp:this.value>
<xc:Widgets_Field
field_datasource="#{javascript:currentDocument}"
field_name="#{javascript:fieldname}">
</xc:Widgets_Field>
</xp:repeat>
我试图清空cc,但没有成功。唯一有效的是,当我对属性field_name进行硬编码时,或者当我将repeat控件设置为“在页面创建时创建控件”时
我绝对确定代码之前是有效的,但我无法找出导致错误消息的原因。你能试一下吗?如果你也有同样的问题,请告诉我。
附件请参见堆栈跟踪
com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression
com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)
com.ibm.xsp.page.compiled.ExpressionEvaluatorImpl.getBindingValue(ExpressionEvaluatorImpl.java:151)
xsp.Widgets_005fField$Widgets_005fFieldPage.createInputText4(Widgets_005fField.java:776)
xsp.Widgets_005fField$Widgets_005fFieldPage.createComponent(Widgets_005fField.java:142)
com.ibm.xsp.page.compiled.AbstractCompiledPage.buildComponent(AbstractCompiledPage.java:265)
com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:115)
com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)