0
votes

I have an ordering system in xPages. In the main order form I accept the customer information as document1 and save those fields as fOrderForm (Form). On the same page I have a view control with all the items ordered which are stored as separate documents than the Customer data. I can save these as new documents with no issues. When I go to open one of the orders which would need code to set a viewScope variable to the order number so the view control can display the order items, it gives me the following error. I have Anonymous set at Editor. I'm new to xPages. Can someone shed some light?

com.ibm.xsp.FacesExceptionEx: Could not open the document
    com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(Unknown Source)
    com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(Unknown Source)
    com.ibm.xsp.model.AbstractDocumentDataSource.load(Unknown Source)
    com.ibm.xsp.model.AbstractDataSource.getDataContainer(Unknown Source)
    com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(Unknown Source)
    com.ibm.xsp.model.AbstractDataSource.pushData(Unknown Source)
    com.ibm.xsp.util.DataPublisher.publishControlData(Unknown Source)
    com.ibm.xsp.component.UIViewRootEx.publishControlData(Unknown Source)
    com.ibm.xsp.component.UIViewRootEx.initBeforeContents(Unknown Source)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(Unknown Source)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(Unknown Source)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(Unknown Source)
    com.ibm.xsp.application.ViewHandlerEx.createView(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)
NotesException: Invalid universal id
    lotus.domino.local.Database.NgetDocumentByUNID(Native Method)
    lotus.domino.local.Database.getDocumentByUNID(Unknown Source)
    com.ibm.xsp.model.domino.DominoUtils.getDocumentById(Unknown Source)
    com.ibm.xsp.model.domino.DominoUtils.getDocumentById(Unknown Source)
    com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(Unknown Source)
    com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(Unknown Source)
    com.ibm.xsp.model.AbstractDocumentDataSource.load(Unknown Source)
    com.ibm.xsp.model.AbstractDataSource.getDataContainer(Unknown Source)
    com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(Unknown Source)
    com.ibm.xsp.model.AbstractDataSource.pushData(Unknown Source)
    com.ibm.xsp.util.DataPublisher.publishControlData(Unknown Source)
    com.ibm.xsp.component.UIViewRootEx.publishControlData(Unknown Source)
    com.ibm.xsp.component.UIViewRootEx.initBeforeContents(Unknown Source)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(Unknown Source)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(Unknown Source)
    com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(Unknown Source)
    com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(Unknown Source)
    com.ibm.xsp.application.ViewHandlerEx.createView(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)
1
as I see in the stacktrace you are trying to open the document with an invalid Id. Can you show how you open the page, with which url?Frank van der Linden
localhost/SalesOrders.nsf/… This is what the link from the view is.Mike Gonzalez
The url wants to open the $$OpenDominoDocument. That is a default action in a view panel. To make it work there should be a xpage with the same name of the form who is trying to be opened. Or an XPage set as default to be opened in the database properties. See stackoverflow.com/questions/29164009/…Frank van der Linden
I do have a form named what the document has for Form. In that form, I also tell the system to open the xpage for the order.Mike Gonzalez

1 Answers

1
votes

viewScope variables can't be used in some dominoDocument datasource properties, for example documentId, if it's attached to the XPage or Custom Control. I covered this in my recent session at IBM Connect and I'll be covering it again at Engage next week.

Move it to a Panel and you'll be fine.