Setting Window Name(title) dynamically for a pop up window
Hi,
I have a requirement to open a pop up on a click of link, which will open a document(can be anything like .txt, .doc,.pdf etc) from an external url. This functionality is implemented by using a html control where on click of the link a javascript function is invoked which inturn invokes the openurlinwindow function. Code snippet as given below
var NewWin = openUrlInWindow(externalurl, "NewDoc",PopupWindowFeatures);
Now this works fine except that the url is displayed in the title bar by default and the user wants it displayed by the document name. I have tried setting the Document name value to the html title property as per below but it is not reflected in the title bar.
NewWin.document.title = Document Name;
I have also tried some other approaches like setting a delay and executing the above expression after the document is loaded, also tried to open the url in a specific frame in the html page but none of it seems to work, if anyone has any idea on how to implement this or has faced a similar issue please help with this.
Thank you for your time.
@Private - This wrapper function will open a form in a new window
@param $String$ oUrl - A string specifying the URL to open in the new window.
@param $String$ sName - A string specifying the window name to use in the TARGET attribute of a FORM or A tag. windowName can contain only alphanumeric or underscore(_) characters.
@param $String$ sOptions - A string containing a comma-separated list determining whether or not to create various standard window features.
@param $boolean$ bReplace - A Boolean parameter that specifies whether the sURL creates a new entry or replaces the current entry in the window's history list.
@return $object$
*/
openUrlInWindow: function(oUrl, sName, sOptions, bReplace,event)
{
if(pega.u.d.bWarnBeforeChangingWindow == true && !showDialogForWindowChange()) return;
event = event == undefined?window.event : event;
if (event != null) {
pega.util.Event.stopEvent(event);
}
return desktopwrappersupport_openUrlInWindow(oUrl, sName, sOptions, bReplace);
},
@Private - This wrapper function will open a form in a new window
@param $String$ oUrl - A string specifying the URL to open in the new window.
@param $String$ sName - A string specifying the window name to use in the TARGET attribute of a FORM or A tag. windowName can contain only alphanumeric or underscore(_) characters.
@param $String$ sOptions - A string containing a comma-separated list determining whether or not to create various standard window features.
@param $boolean$ bReplace - A Boolean parameter that specifies whether the sURL creates a new entry or replaces the current entry in the window's history list.
@return $object$
*/
openUrlInWindow: function(oUrl, sName, sOptions, bReplace,event)
{
if(pega.u.d.bWarnBeforeChangingWindow == true && !showDialogForWindowChange()) return;
event = event == undefined?window.event : event;
if (event != null) {
pega.util.Event.stopEvent(event);
}
return desktopwrappersupport_openUrlInWindow(oUrl, sName, sOptions, bReplace);
},
This is the definition of openUrlInWindow. so please send document name as the second parameter in your method.You can use jsp to read the document name from a property in clipboard. you can also hide the location bar(this parameter has to be set in sOptions). I suggest try configuring a button(OOTB) with to do open url in window and look into the options.Please see below screenshot.
Thanks,
Ashok