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



Mar 13, 2013, 6:36 PM
17 Posts
topic has been resolvedResolved

Display attachment in richtext field

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer,Administrator
  • Tags:
  • Replies: 9
 I am trying to launch an attachment and get it to open in a different Xpage.
For the href, if I use:
http://<server>/app.nsf/0/AEFFA9409ED0E1ED80257B1900556AB8/$file/xpages.pdf?open
This will open the attachment fullscreen in a new window, but I want it to open in an Xpage I specify
For the href, if I use:
http://<server>/app.nsf/DocView.xsp?documentId=AEFFA9409ED0E1ED80257B1900556AB8&action=openDocument
I get the "See attached file: xpages.pdf" in the Rich Text field.
How do I get the attachment contents to display in the richtext field of my DocView.xsp page?
I am trying to replicate the "default frame for links"  when using framesets with traditional notes dev.
Mar 14, 2013, 1:27 AM
586 Posts
Re: Display attachment in richtext field
 I'm not sure the answer but make sure you review this post by Stephan.  It might be helpful.
 
http://www.wissel.net/blog/d6plinks/SHWL-86QKNM 
 
 
Mar 14, 2013, 8:52 AM
17 Posts
Re: Display attachment in richtext field
Thanks David,
I have already seen this post (an loads like it), but all it explains is how to get the URL to the attachment and then open it. 
 
I want to be able to open the attachment in a richtext field on an xpage,  not in it's own window.   Sort of when you open an attachment in a frame of a frameset.
Mar 14, 2013, 5:33 PM
586 Posts
Re: Display attachment in richtext field
 Maybe I'm missing it.. and I'm not that good at rich text stuff on xpages...  but don't you build a link to the attachment and add something like target="_self" or something like that?  I could be totally off base here though.
 
 
Mar 15, 2013, 11:45 AM
17 Posts
Re: Display attachment in richtext field
Hi David, thanks for the response........
 
This does not work.  I have tried: 

window.open("/inet.nsf/0/AEFFA9409ED0E1ED80257B1900556AB8/$file/xpages.pdf", "_parent");

 And _top, _self, _blank    All to no avail.  
 
window.open() supports the following: 
  • _blank - URL is loaded into a new window. This is default
  • _parent - URL is loaded into the parent frame
  • _self - URL replaces the current page
  • _top - URL replaces any framesets that may be loaded

As I do not have frames or framesets, the attachment opens entirely in a window, and not in the area of the xpage it was launched from.

Mar 15, 2013, 12:58 PM
17 Posts
Re: Display attachment in richtext field
I think I am going about this all wrong.....
 
What I am trying to do now is to put an iframe on a panel.  My question now is how to I pass the URL of the attachment to the src=  part of the iframe?
Mar 15, 2013, 2:39 PM
17 Posts
Re: Display attachment in richtext field
Nearly there now.   I have passed the url to the page that contains the iFrame.  How do I get the value of computedField1 into the src= part?
 

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

<xp:this.beforePageLoad><![CDATA[#{javascript:viewScope.theValue=sessionScope.theValue;

sessionScope.theValue=null}]]></xp:this.beforePageLoad>

<xp:br></xp:br>

<xp:text escape="true" id="computedField1" value="#{javascript:viewScope.theValue}"></xp:text>

<xp:br></xp:br>

<xp:panel style="height:550px"><iframe id="docframe" src="THIS SHOULD BE THE VALUE OF computedField1" height="100%" width="100%" xp:key="facetMiddle">

</iframe></xp:panel>

<xp:eventHandler event="onClientLoad" submit="true"

refreshMode="norefresh"></xp:eventHandler></xp:view>

 
Mar 15, 2013, 3:40 PM
586 Posts
Re: Display attachment in richtext field
 I don't do a lot with CSJS... but can't you just do:
 
src="#{javascript:viewScope.theValue}" 
 
Certainly the answer would be on XPagesWiki.com if that's not it...  possibly I have it on openntf in the xpages media reader as I was working with a client side video player.... 
 
 
Mar 18, 2013, 9:04 AM
17 Posts
Re: Display attachment in richtext field
Thank you so much David, got it working now.
Mar 18, 2013, 2:55 PM
586 Posts
Re: Display attachment in richtext field
 Cool!  Glad to hear that!  

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