2013-01-24 63 views
0

我被指出這個網站爲我的問題下面。xpages - 複選框null

我借用了OpenNTF.org的複選框代碼。該項目是 - http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&documentId=CDD107F4006F7D5C8625775F001B8C61

我已經將它集成到xPage中,並且在本地,在Web瀏覽器和手持設備上的Notes客戶端中運行時,它工作正常。但是,當在多米諾服務器上的副本上運行時,列數的值將爲空。多米諾骨牌服務器是8.5.3 FP1。

不知道爲什麼只有在Domino客戶端通過Notes客戶端在本地客戶端正常工作時纔出現錯誤。

感謝, 沃爾特

以下是錯誤

意外的運行時錯誤 運行時遇到意外的錯誤。 錯誤源 頁面名稱:/Company.xsp 器識別號: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) 
+2

你應該在OpenNTF上關於組件的討論中寫這個。因爲它可能是一個應用程序問題。該組件的開發者將會最好地回答它。 –

+1

您對ACL和服務器副本上的相同數據擁有足夠的權限嗎? –

+0

我已經通過電子郵件發送了該項目的開發者,他們建議我在這裏發佈它。 ACL很好,因爲我通過瀏覽器以及Notes客戶端使用相同的ID訪問它。如果是和ID問題,瀏覽器或手持設備應顯示相同的結果。 – WaltS

回答

1

腳本解釋器錯誤是「'compositeData.FieldValues'爲空」。在任何自定義控件的上下文中都是如此,compositeData是指傳遞給自定義控件的屬性映射的變量。因此,如果compositeData.FieldValuesnull,則無論表達式分配給自定義控件的FieldValues屬性,該表達式的計算結果爲null

對於您的情況,表達式compositeData.FieldValues.length會引發錯誤,因爲null沒有長度(...或其他任何屬性或方法)。

您曾表示能正常工作在下列情況:

  • Notes客戶端,本地副本
  • 瀏覽器訪問服務器
  • 移動設備訪問服務器

什麼三個場景的共同之處在於代碼在本地運行。當您通過瀏覽器(包括移動設備)訪問XPage時,您正在訪問某個服務器,但執行的代碼本身就是本地代碼......它不需要對另一臺Domino服務器進行NRPC調用來運行代碼。

因此,它出現故障的一種情況是,情況並非如此:從Notes客戶端訪問服務器副本。我猜你傳遞給FieldValues的表達式使用的是@DbLookup()或類似的操作,但沒有正確說明代碼運行在哪個服務器上,導致它將null傳遞給自定義控件。

+0

它確實做了查找,我會查看dblookup公式 – WaltS

+0

就是這樣,沒有在查找中查看服務器。正在尋找當地的數據庫。謝謝您的幫助 – WaltS