Solved

How to control window size

Posted on 2004-03-29
16
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

726 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