Solved

How to control window size

Posted on 2004-03-29
16
201 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now