0

我在下面的问题中被指向该站点。

我从 OpenNTF.org 借用了复选框代码。该项目是 - http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&documentId=CDD107F4006F7D5C8625775F001B8C61

我已将它集成到 xPage 中,并且在本地、Web 浏览器和手持设备上的 notes 客户端中运行时运行良好。但是,当在 domino 服务器上的副本上运行时,列数的值为 null。多米诺服务器是 8.5.3 FP1。

不知道为什么只有在通过notes客户端在domino服务器上时才出现错误,而它在本地客户端中工作得很好。

谢谢,沃尔特

这是错误

意外的运行时错误 运行时遇到意外错误。错误源页面名称:/Company.xsp 控件 ID:rowRepeat

执行 JavaScript 计算表达式时出现异常错误脚本解释器错误,行 = 1,列 = 37:'compositeData.FieldValues' 为空

JavaScript 代码

Math.ceil(compositeData.FieldValues.length / compositeData.numberOfColumns);

堆栈跟踪

com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression
com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(Unknown Source)
com.ibm.xsp.component.UIDataIterator.getValue(Unknown Source)
com.ibm.xsp.component.UIDataIterator.createDataModel(Unknown Source)
com.ibm.xsp.component.UIDataIterator.getDataModel(Unknown Source)
com.ibm.xsp.component.UIDataIterator.setRowIndex(Unknown Source)
com.ibm.xsp.renderkit.html_extended.IteratorRenderer.encodeRows(Unknown Source)
com.ibm.xsp.renderkit.html_extended.IteratorRenderer.encodeChildren (Unknown Source)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
com.ibm.xsp.component.UIDataIterator.encodeChildren(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
com.ibm.xsp.component.UIViewRootEx._renderView(Unknown Source)
com.ibm.xsp.component.UIViewRootEx.renderView(Unknown Source)
com.ibm.xsp.application.ViewHandlerExImpl.doRender(Unknown Source)
com.ibm.xsp.application.ViewHandlerExImpl._renderView(Unknown Source)
com.ibm.xsp.application.ViewHandlerExImpl.renderView(Unknown Source)
com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source)
com.sun.faces.lifecycle.LifecycleImpl.phase(Unknown Source)
com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source)
com.ibm.xsp.controller.FacesControllerImpl.render(Unknown Source)
com.ibm.xsp.webapp.FacesServlet.serviceView(Unknown Source)
com.ibm.xsp.webapp.FacesServletEx.serviceView(Unknown Source)
com.ibm.xsp.webapp.FacesServlet.service(Unknown Source)
com.ibm.xsp.webapp.FacesServletEx.service(Unknown Source)
com.ibm.xsp.webapp.DesignerFacesServlet.service(Unknown Source)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet (Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(Unknown Source)
com.ibm.designer.runtime.domino.adapter.ComponentModule $AdapterInvoker.invokeServlet(Unknown Source)
com.ibm.designer.runtime.domino.adapter.ComponentModule $ServletInvoker.doService(Unknown Source)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService (Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFService.access$0(Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceRequest.call(Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceRequest.call(Unknown Source)
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceThread.run(Unknown Source)

.

com.ibm.jscript.InterpretException: Script interpreter error, line=1, col=37: compositeData.FieldValues' is null
    com.ibm.jscript.ASTTree.ASTMember.interpret(Unknown Source)
    com.ibm.jscript.ASTTree.binaryop.ASTBinaryDefaultOp.interpret(Unknown Source)
    com.ibm.jscript.ASTTree.ASTArgumentList.interpretArguments(Unknown Source)
    com.ibm.jscript.types.FBSObject.call(Unknown Source)
    com.ibm.jscript.ASTTree.ASTCall.interpret(Unknown Source)
    com.ibm.jscript.ASTTree.ASTProgram.interpret(Unknown Source)
    com.ibm.jscript.ASTTree.ASTProgram.interpretEx(Unknown Source)
    com.ibm.jscript.JSExpression._interpretExpression(Unknown Source)
    com.ibm.jscript.JSExpression.access$1(Unknown Source)
    com.ibm.jscript.JSExpression$2.run(Unknown Source)
    java.security.AccessController.doPrivileged(Unknown Source)
    com.ibm.jscript.JSExpression.interpretExpression(Unknown Source)
    com.ibm.jscript.JSExpression.evaluateValue(Unknown Source)
    com.ibm.jscript.JSExpression.evaluateValue(Unknown Source)
    com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(Unknown Source)
    com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(Unknown Source)
    com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(Unknown Source)
    com.ibm.xsp.component.UIDataIterator.getValue(Unknown Source)
    com.ibm.xsp.component.UIDataIterator.createDataModel(Unknown Source)
    com.ibm.xsp.component.UIDataIterator.getDataModel(Unknown Source)
    com.ibm.xsp.component.UIDataIterator.setRowIndex(Unknown Source)
    com.ibm.xsp.renderkit.html_extended.IteratorRenderer.encodeRows(Unknown Source)
    com.ibm.xsp.renderkit.html_extended.IteratorRenderer.encodeChildren (Unknown Source)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    com.ibm.xsp.component.UIDataIterator.encodeChildren(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
    com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
    com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
    com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderChildren(Unknown Source)
    com.ibm.xsp.renderkit.html_extended.HtmlBasicRenderer.encodeChildren (Unknown Source)
    com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.encodeChildren(Unknown Source)
    javax.faces.component.UIComponentBase.encodeChildren(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.util.FacesUtil.renderComponent(Unknown Source)
    com.ibm.xsp.component.UIViewRootEx._renderView(Unknown Source)
    com.ibm.xsp.component.UIViewRootEx.renderView(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl.doRender(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl._renderView(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl.renderView(Unknown Source)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(Unknown Source)
    com.sun.faces.lifecycle.LifecycleImpl.phase(Unknown Source)
    com.sun.faces.lifecycle.LifecycleImpl.render(Unknown Source)
    com.ibm.xsp.controller.FacesControllerImpl.render(Unknown Source)
    com.ibm.xsp.webapp.FacesServlet.serviceView(Unknown Source)
    com.ibm.xsp.webapp.FacesServletEx.serviceView(Unknown Source)
    com.ibm.xsp.webapp.FacesServlet.service(Unknown Source)
    com.ibm.xsp.webapp.FacesServletEx.service(Unknown Source)
    com.ibm.xsp.webapp.DesignerFacesServlet.service(Unknown Source)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet (Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(Unknown Source)
    com.ibm.designer.runtime.domino.adapter.ComponentModule $AdapterInvoker.invokeServlet(Unknown Source)
    com.ibm.designer.runtime.domino.adapter.ComponentModule
$ServletInvoker.doService(Unknown Source)
    com.ibm.designer.runtime.domino.adapter.ComponentModule.doService (Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFService.access$0(Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceRequest.call(Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceRequest.call(Unknown Source)
    java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    java.util.concurrent.FutureTask.run(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
    com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceThread.run(Unknown Source)
4

1 回答 1

1

脚本解释器错误是“'compositeData.FieldValues' 为空”。在任何自定义控件的上下文中都是如此,compositeData是指传递到自定义控件的属性映射的变量。因此,如果compositeData.FieldValuesnull,那么无论分配给FieldValues自定义控件属性的表达式,该表达式的计算结果都是null

在您的情况下,表达式compositeData.FieldValues.length会引发错误,因为null没有长度(...或任何其他属性或方法,就此而言)。

您已经表明这在以下情况下可以正常工作:

  • Notes 客户端,本地副本
  • 浏览器访问服务器
  • 移动设备访问服务器

这三种情况的共同点是代码在本地运行。当您通过浏览器(包括移动设备)访问 XPage 时,您正在访问某个服务器,但执行的代码是其自身的本地代码……它不必对另一个 Domino 服务器进行 NRPC 调用来运行代码.

因此,它失败的一种情况是不正确的一种情况:从 Notes 客户端访问服务器副本。我猜你传递给的表达式正在FieldValues使用@DbLookup()或类似的操作,但没有正确考虑代码正在运行的服务器,导致它传递null给自定义控件。

于 2013-01-25T10:47:10.683 回答