xCP 2.1 Custom JavaScript Function to Print iFrame Contents
Hello everybody,
In xCP 2.1 P05, we have created an application page which has iFrames [Using a value display, HTML type]. We need to provide an option to the user to print the contents of the iFrame only. For this we can use below core statement:
document.getElementById(frameID).contentWindow.print();
We have tried to create a custom javascript function, through a library, but this function is not getting listed in the widget's functions.
.js contents:
----------------------------------
Ext.namespace ('ntt.functions');
ntt.functions.mgcPrintIFrame = function (iFrameID) {
document.getElementById(frameID).contentWindow.print()
};
---------------------------------
Attached is the custom library created for this.
Appreciate feedback/findings.
Thank you.
Raghu.
Comments
-
Try changing the bundle-name to mgc.PrintIFrame
0 -
Hi Raghu,
The component-bundle name in the Manifest file should match the namespace in the JS file. In the above Jar, component-bundle name is PrintIFrame and the namespace in JS file is ntt.functions.
Replace ntt.functions with PrintIFrame in
1) JS File
2) xml file (namespace)
3) upload the new jar.
0 -
I don't see any problem with MANIFEST or XML. Can you just try adding return value to the function? e.g. have return type of STRING, and the just return some dummy string from the function.
0 -
I am using xcp 2.2 , we are having one requirement where we want to print
view page of a business object.is there any way we can achieve this? are you able to print iframe content?
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 151 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories