Solved

How to control window size

Posted on 2004-03-29
16
200 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
Comment Utility
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
Comment Utility
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
Comment Utility
in hemanth's answer there was a typo it's not javscript, it's javascript


;-)

Partha
0
 

Author Comment

by:adspmo
Comment Utility
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
Comment Utility
@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
Comment Utility
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
Comment Utility
@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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
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
Comment Utility
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
Comment Utility
there is no RTGopenwindow, use the one which hemanth gave you

Partha
0
 

Author Comment

by:adspmo
Comment Utility
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
Comment Utility
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
Comment Utility
Ya

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

Expert Comment

by:HemanthaKumar
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

12 Experts available now in Live!

Get 1:1 Help Now