Solved

How to control window size

Posted on 2004-03-29
16
204 Views
Last Modified: 2013-12-18
HI

I have a requirement that would open a link in a smaller window

Here is the link
@If(ItemNo ="";""; "[<A HREF=\'/" + @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument" + "\'>Click Link to Open Action</A>]")

Cheers

James
0
Comment
Question by:adspmo
  • 5
  • 4
  • 4
  • +1
16 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 10707751
You have to change the call to window.open ... there are parameters for the call, which include width and height values.
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 10708002
use function and pass the url to the function like this , paste this is JSHeader

function winOpen(url) {

window.open( url, "height=100,widht=100");

}


@If(ItemNo ="";@Return("#");"" );
url =  @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument";
"[<A HREF=" + "javscript:winOpen('" + url +  "')" + "</A>]"

PS: Check quotes to match in url parameter

~Hemanth

0
 
LVL 14

Expert Comment

by:p_partha
ID: 10708210
in hemanth's answer there was a typo it's not javscript, it's javascript


;-)

Partha
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:adspmo
ID: 10708247
There are a few things her I don't get

@If(ItemNo ="";@Return("#");"" ); Return # else nothing???
url =  @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument";What do they click on to open window???
"[<A HREF=" + "javscript:winOpen(\'" + url +  "\')" + "</A>]"

+ "</A>]"+ what??
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10708264
@If(ItemNo ="";@Return("#");"" );
url =  @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument";
"[<A HREF=" + "javascript:winOpen('" + url +  "')" + "Click Link to open action</A>]"


Partha
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10708288
sorry typo

@If(ItemNo ="";@Return("#");"" );
url =  @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument";
"[<A HREF=" + "javascript:winOpen('" + url +  "')" + ">Click Link to open action</A>]"

Partha
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10708291
@return will stop execution of href and just point to current document if itemno happens to be null.

Partha blame it on my fat finger ;-)

0
 

Author Comment

by:adspmo
ID: 10714311
OK

I have added, the folowing . It now shows Click Link to open action beside every document

@If(ItemNo ="";@Return("#");"" );
url =  @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument";
"[<A HREF=" + "javascript:winOpen('" + url +  "')" + ">Click Link to open action</A>]"
 
function winOpen(url) {
window.open( url, "height=100,widht=100");
}
The URL is javascript: RTGOpenWindow('javascript:winOpen('')', 'RTGWin')
When clicked it says erorr on page
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10714440
missed : in the formula, try this one

@If(ItemNo ="";@Return("#");"" );
url :=  @ReplaceSubstring(@Subset(@DbName;-1); "\\"; "/") + "/LINK2/" + ItemNo + "?Opendocument";
"[<A HREF=" + "javascript:winOpen('" + url +  "')" + ">Click Link to open action</A>]"
0
 

Author Comment

by:adspmo
ID: 10714526
Here is the URL
javascript: RTGOpenWindow('javascript:winOpen('PPM/PPMREQ.nsf/LINK2/100150?Opendocument')', 'RTGWin')

I get error on page still. Is it theRTGOpenWindow?
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10714545
there is no RTGopenwindow, use the one which hemanth gave you

Partha
0
 

Author Comment

by:adspmo
ID: 10714628
function RTGOpenWindow( DocURL, WinName, WinArgs, WinTitle )
{
      a = WinArgs ? WinArgs : "left=0, top=0,width=" + (screen.availWidth-7) + ",height=" + (screen.availHeight-27) + ",status=no,toolbar=no,menubar=no,location=no,resizable=no"
      n = WinName ? WinName : "RTG" + document.uniqueID
      t = WinTitle ? WinTitle : ""
      win = window.open(DocURL, n, a)
      setTimeout("win.focus()", 100)

}
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10714809
Oh, James, c'mon, it was staring you in the face, all along!  RTGOpenWindow dynamically calculates what it thinks is an appropriate window size (availWidth-7, availHeight-27), unless you pass in your own parameters.

So, ALL you need to do is change the RTGOpenWindow call:

javascript: RTGOpenWindow('PPM/PPMREQ.nsf/LINK2/100150?Opendocument', 'RTGWin', 'width=400,height=250')
0
 

Author Comment

by:adspmo
ID: 10715469
Ya

I saw that I just can't figure out why it is opening full screen
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10715721
well you have the function already ?

Qwal already gave the method how to use it. Unless you are getting some other error.

0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10715880
James,

I remember you called this function elsewhere, so you know how to use it. Theonly difference is, that you need to make sure there is a third parameter to the RTF... call, which says 'width=x,height=y' (x and y are pixel counts).
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question