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 30, 2012, 12:31 PM
43 Posts
topic has been resolvedResolved

Response Document in a new window

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags: Response Document
  • Replies: 4
 Any idea of how to open a response document in a new window?
I have to use server side javascript so cant use window.open() 
I am having a list of items and based on selected item i want to create a response document. Only problem is that I wish to open it in a window of fixed size. 
 
Any suggestions would be really helpful.. 
Mar 30, 2012, 5:52 PM
56 Posts
Re: Response Document in a new window
Hi,
 
what do you want to do exactly? Do you want to open a new tab or a new window with an XPage? Then try to use the target property of the link (propably not in the editor area). But I don't know whether this is working in XPages, haven't tried it so far.
 
Or do you want to open a dialog? You can achieve this with dojo, try something like that:
 
<xc:fkZetaDialog dialogID="dialog">
        <xc:this.dialogTitle><![CDATA[#{javascript:"some computed text")}]]></xc:this.dialogTitle>
        <xp:this.facets>
            <xp:div xp:key="facetDialogContainer" id="dialog">
            </xp:div>
        </xp:this.facets>
    </xc:fkZetaDialog>
 
Call it with this:
 
<xp:eventHandler event="onclick" submit="false">
                                        <xp:this.script><![CDATA[
                                            XSP.allowSubmit();
                                            dijit.byId("#{id:dialog}").show()]]>
                                        </xp:this.script>
                                    </xp:eventHandler>
 
Don't forget to include this in your XPage in the ressource section:
<xp:dojoModule name="dijit.Dialog" />
 
The Zeta Dialog control you can get from here:
http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=9BB0002FE3452618852578CB0066AB75 
 
This is my code for the zetaDialog control itself:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:this.resources>
        <xp:script src="/dojoZetaDialog.js" clientSide="true"></xp:script>
        <xp:styleSheet href="/styleme.css"></xp:styleSheet>
        <xp:styleSheet href="/style_s.css" />
        <xp:styleSheet href="/fk-xpages.css" />
    </xp:this.resources>
    <xp:panel id="${javascript:compositeData.dialogID}"
        dojoType="com.ZetaOne.widget.Dialog"
        style="width:700px;height:400px; border: solid green 1px">
        <xp:this.dojoAttributes>
            <xp:dojoAttribute name="title"
                value="#{javascript:compositeData.dialogTitle}" />
        </xp:this.dojoAttributes>
        <xp:panel id="dialogpanel">
            <xp:callback facetName="facetDialogContainer"
                id="callbackDialogContainer">
            </xp:callback>
        </xp:panel>
    </xp:panel>
</xp:view>
 
Also use this code as a javascript library:
dojo.provide('com.ZetaOne.widget.Dialog');
dojo.require('dijit.Dialog');
(function(){
        dojo.declare("com.ZetaOne.widget.Dialog", dijit.Dialog, {
                disableCloseButton: false,
                 _onKey: function(evt)
                {
                    if(this.disableCloseButton && evt.charOrCode == dojo.keys.ESCAPE) return;
                    this.inherited(arguments);
                },
                setCloseButtonDisabled: function(flag)
                {
                    this.disableCloseButton = flag;
                    this._updateCloseButtonState();
                },
                _updateCloseButtonState: function()
                {
                    dojo.style(this.closeButtonNode,
                    "display",this.disableCloseButton ? "none" : "block");
                },
                postCreate: function(){
                    this.inherited(arguments);
                    this._updateCloseButtonState();
                    dojo.query('form', dojo.body())[0].appendChild(this.domNode);
                },
                _setup: function() {
                    this.inherited(arguments);
                    if (this.domNode.parentNode.nodeName.toLowerCase() == 'body')
                        dojo.query('form', dojo.body())[0].appendChild(this.domNode);                
                }                
        })
}());
 
To select the response document, there is nothing special to do, you only need the UNID of the document.
 
Hope this helps.
Mar 30, 2012, 6:08 PM
17 Posts
Re: Response Document in a new window
To open it in another xpage try something like
(example is a viewcolumn with an image as a link to open the document)
 
<xp:viewColumn id="viewColumn19" value=""
                style="width:38px">
                <xp:this.facets>
                    <xp:viewColumnHeader xp:key="header"
                        id="viewColumnHeader18" value=" " style="width:35px" />
                </xp:this.facets>
 
<xp:link id="Print" target="_blank"
                    rendered="#{javascript:row.isDocument()}">
                    <xp:this.value><![CDATA[#{javascript:var unid = row.getUniversalID();
return "Print.xsp?documentId=" + unid + "&action=openDocument";}]]></xp:this.value>
                    <xp:image id="image1" url="/action_print.gif"
                        alt="printen" title="#{javascript:this.getAlt()}">
                    </xp:image>
                </xp:link>
</xp:viewColumn>
Mar 30, 2012, 6:26 PM
56 Posts
Re: Response Document in a new window
- deleted -
 
Why is there no function to delete own posts...
May 14, 2012, 8:03 AM
43 Posts
Re: Response Document in a new window
 Guys, 
Thank you for your reply.. 
I had some issues on that..but later used some tricks by accessing server side in client side.. 
 
Sorry for the late reply..! 

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