0
votes

Am coming across an intermittent problem when opening an Xpage. I have a button on a dialog to open another XPage in a new browser window, the code in the button is

var path = facesContext.getExternalContext().getRequest().getContextPath();
var xpage = "Claim.xsp"
var fullpath = path + "/" + xpage;
var url = fullpath + "?action=openDocument&documentId="+ Action.claimDocID
view.postScript("window.open('" + url + "')"

(if anyone has another way instead of the view.postScript let me know, just couldn't figure out how to open in a new browser window)

Occasionally when the window opens I'll get an error - Could not open document, below is the entry in the log.

05/04/2017 08:26:10 AM HTTP JVM: CLFAD0131E: Unable to push data because: Could not open the document. For more detailed information, please consult error-log-0.xml located in C:/IBM/Domino/data/domino/workspace/logs 05/04/2017 08:26:10 AM HTTP JVM: com.ibm.xsp.webapp.FacesServlet$ExtendedServletException: com.ibm.xsp.FacesExceptionEx: Could not open the document

CLFAD0131E: Unable to push data because: Could not open the document com.ibm.xsp.FacesExceptionEx: Could not open the document at com.ibm.xsp.model.domino.DominoDocumentData.doOpenDocument(DominoDocumentData.java:529) at com.ibm.xsp.model.AbstractDocumentDataSource.openDocument(AbstractDocumentDataSource.java:148) at com.ibm.xsp.model.AbstractDocumentDataSource.load(AbstractDocumentDataSource.java:100) at com.ibm.xsp.model.AbstractDataSource.getDataContainer(AbstractDataSource.java:474) at com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(DominoDocumentData.java:165) at com.ibm.xsp.model.AbstractDataSource.pushData(AbstractDataSource.java:576) at com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:181) at com.ibm.xsp.component.UIViewRootEx.publishControlData(UIViewRootEx.java:1288) at com.ibm.xsp.component.UIViewRootEx.initBeforeContents(UIViewRootEx.java:1615) at com.ibm.xsp.page.compiled.AbstractCompiledPage.init

<-- is from the error-log-0.xml

BUT, when I press reload on the browser the page loads, so the URL is correct. I placed all sorts of print statements on the XPage, in the Java managed bean it also uses, and when the error occurs nothing is printed. The error is immediate, whereas when reloading it takes time and the messages are printed. After the first error, it doesn't occur again.

A couple of other things about this application, it is password protected, it is running on HTTPS. The XPage it loads does have a Notes document that's located in another database plus it uses a Managed bean. If anyone has any ideas be grateful.

Thanks

Cameron

4

4 Answers

0
votes

In regards to opening a given page in a new tab: have you tried using a link control instead of a button? Set a computed target url (preferably under "All Properties >> data >> value") AND set the target property to "_blank" ("All Properties >> basics >> target")

Using css you can later on modify the link to look like a button, if that's needed.

Btw: in general there's no need to calculate the path if you stay within the same database; the XSPcontext sees the .nsf as a common root. Just have your url point to "/myNewPage.xsp" then add the query string accordingly, like

var url = "/" + xpage + "?action=openDocument&documentId="+ Action.claimDocID
0
votes

This error happens when universal ID provided to documentId URL parameter is invalid - possibly a document from another database or user has no access to it (readers field).

0
votes

Just use a link with a target="_blank" parameter:

<xp:link value="/my_page_name.xsp" text="to the infinity and beyond" target="_blank">
    <xp:this.parameters>
        <xp:parameter name="action" value="openDocument" />
        <xp:parameter name="documentId" value="#{Action.claimDocID}" />
    </xp:this.parameters>
</xp:link>
0
votes

I have same error. In My Case I was remove field In Shared Elements. After Field was restored, error is disappear.