This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 18, 2014, 7:41 PM
13 Posts
topic has been resolvedResolved

open document from button

  • Category: Other
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags: button,open document
  • Replies: 8

I have an XPage with a button that has to accomplish 3 things:

1) set the value for a field
2) save the document
3) open a traditional notes document

I cannot get the button to open the traditional notes document.  I can get this to work in a link (which I do not want to use because I need the button to do #1 & #2 above) with the following code:

<xp:link escape="true" text="Close" id="link1">
<xp:this.value>
<![CDATA[http://name1/Test.nsf/44694393939392292929229/1773604038827272790303?OpenDocument]]>
</xp:this.value></xp:link>

How can I achieve this using a button? 

Sep 22, 2014, 2:29 PM
453 Posts
*You want to open the document in a native Notes form?
Sep 22, 2014, 6:13 PM
13 Posts
open document from button

Yes, that is correct.  I have created new applications in XPages, but still have other applications written in native Notes.  So, from the new XPage applications, I need to navigate back to older documents, so I would like the user to click on a button which will set field values, save the document and then navigate them to a native notes document.

Sep 29, 2014, 1:53 PM
13 Posts
open traditional notes document from XPage button

To have a button open an XPage, the source code looks like this:

<xp:button value="test" id="button3" styleClass="button">
                 <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
                <xp:this.action>
                    <xp:openPage target="openDocument"
                        name="/Test.nsf/44692d275f957997852579e2004d61ed"
                        documentId="17b45b134f5c942585257b250054ab4a">
                    </xp:openPage>
                </xp:this.action>
            </xp:eventHandler>
        </xp:button>

I need to open a document in traditional notes and it gives me an error message when I try to do that using this method, maybe because of the <xp:openPage> command.  I have tried a lot of other commands in place of the <xp:openPage> like:

<xp:button value="test" id="button9" styleClass="button">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
                <xp:this.action>
                           <![CDATA[window.open("http://test/Test.nsf/2d14d7438b3c1c0f85256b9c005f80ae/faad27d8dc6e428285256bb10068d786?OpenDocument",'_blank');]]></xp:this.action>
            </xp:eventHandler>
        </xp:button>

but, they don't seem to work.                          

Sep 29, 2014, 3:27 PM
13 Posts
solution

I found the solution, here is the code to open a traditional notes document using an XPage button:

 

        <xp:button value="test" id="button9" styleClass="button">
     
            <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
                <xp:this.script>
                    <![CDATA[window.open("http://test/Test.nsf/2d14d7438b3c1c0f85256b9c005f80ae/faad27d8dc6e428285256bb10068d786?OpenDocument",'_blank');]]>
                </xp:this.script>
            </xp:eventHandler>
        </xp:button>

 

Using <xp:this.script> before the CDATA statement solved the problem.

Sep 29, 2014, 4:59 PM
13 Posts
still need help

Actually, the post that I made labeled "Solution", opens the page in a new window.  I'd like to stay in the window that I was originally in, any ideas for the code to achieve that?

 

Sep 29, 2014, 11:10 PM
33 Posts
Try _self instead of _blank

Christine,

 

I think it may be the _blank parameter you are passing to the call that is causing the new window.  The option I think you need is _self.  Check here if you want to see what else you can do with that http://www.w3schools.com/jsref/met_win_open.asp


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal