Solved

javascript problem

Posted on 2001-07-24
15
203 Views
Last Modified: 2013-12-18
hello experts,
  I created one navigartor in that navigator  one hotspot button on this.when i click on the hotspot i wrote
a formula
http://abc/ab.nsf/test?openform

   i put the target=_blank so its opening in a new window.
   this is working fine.
 Now the problem is if the user minimizes and again click on hotspot button it will work but user has to manually maximise.
   To solve this problem i wrote javascript
like this

<script language="javascript">
var the_window = null;
function test()
{
 if(!the_window  || the_window .closed)
 {
 the_window  = window.open("http://abc/abcs.nsf","http://abc/abcsTes.nsf/child?openform","left=3,top=2, width=5,height=6,toolbar=0,resizable=0,scrollbars=0,status=0,menubar=0,directories=0,location=0");
  return false;
 }
 else
 {
  the_window.focus();
 }
}

<a href='http://abc/abcTes.nsf/child?openform' ;onclick='test();return false';' target='_blank' >SHAIK </A>



if user clicks on a button it should open a new window if the new window is minimized again it should open the newwindow.
can anybody will help me.

saleem.
0
Comment
Question by:saleemkhan
  • 9
  • 6
15 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 6314350
Hey saleem,

this is a genial trick!!! It works!

The only error you made: the secon parameter in window.open is the window title (not very important).
Put the ?openForm string as first parameter (the URL ) and you will see it working!!!

Good luck,
zvonko

PS: my test was also without this "<A>" tag. I used simple button, like this:
<INPUT TYPE=button onClick="test()" VALUE=" New ">

You need no target, because window.open() is allways standalone window...
0
 
LVL 10

Accepted Solution

by:
zvonko earned 50 total points
ID: 6314397
I also replaced " with single quotes...

here my version:
<SCRIPT LANGUAGE="JavaScript">
<!--
var the_window = null;
function test() {
 if(!the_window  || the_window .closed)
  {
   the_window  = window.open('/dir/db.nsf/myform?OpenForm','titel','left=3,top=2,width=5,height=6,toolbar=0,resizable=0,scrollbars=0,status=0,menubar=0,directories=0,location=0');
   return false;
  } else {
   the_window.focus();
  }
}
// -->
</SCRIPT>
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6314415
you see the blank in: the_window .closed
why does this work? ;-)

...anyway: great!
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:saleemkhan
ID: 6315965
hello zvonko,
   I did the same thing but its not working.
i have first form the url of this say
http://abc/Main.form?openform when i open this form in the broweser when i click on the button
it should open the child form in a new window if the child window is minimized once again if i click on the mainform button it should open me the child window.
i have a doubt in window.open('','')
    1.what i have to pass  in first parameter the url of the form to be opened(child) or the url of the current form(parent)
    2.Is title should be same as the url or full form name anything we can give.

waiting for reply

saleem
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6316340
to 1.) first parameter is the URL of the page to open.
to 2.) title is not used. You set the title of the new page in <TITLE> (or in the Notes form ;-))

but look again at my last comment. It is realy tested for working as desired...
0
 

Author Comment

by:saleemkhan
ID: 6316572
This is my code.But its not opening the child page.

<script language="javascript">
var the_window = null;
function test()
{
 if(!the_window  || the_window .closed)
 {
the_window  = window.open('http://abc/retTest.nsf/childForm?openform','tie','left=30,top=200, width=5,height=6,toolbar=0,resizable=0,scrollbars=0,status=0,menubar=0,directories=0,location=0');
  return false;
 }
 else
 {
  the_window.focus();
 }
}
</script>
<input type=button onclick="test" value="new">


so when i click on new button it should open the child form but its not doing that.
waiting for reply.
saleem.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6316935
you missed the () in function call ;-)

<input type=button onclick="test()" value="new">

good luck,
zvonko
0
 

Author Comment

by:saleemkhan
ID: 6317029

Thanks zvonko,
    sorry to do such a small mistakes.i will accept ur comment but a little more help i think u can.Here i am increasing points to 50.

The same example i  have to implement in frameset.

1.i have a frameset.
2.i have one navigator.
3.in navigator i have 6 Ellipse buttons.
4.when i click on 1st button it should open one form in a new window.
5.By mistake if the user minimizes it should be opened with size as u already gave the example.


  i tried to put the code in the navigator but unable to how to implement the same code when a user click on ellipse.
how can u we do it.

saleem.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6318357
Sorry saleem,

but even for 300 points I have no idea how to embed JavaScript in navigator, 'cose it is all one big gif generated by Domino (and alse the <MAP> and onClick events in it).

The only idea I would have is to take this generated gif (and the html code) and transform it into ImageResources and html passtru page, and then embed this JavaScript calls you need.

But this all is a total change and up to you if you like to go in this direction.

Was my idea understundable to you?
0
 

Author Comment

by:saleemkhan
ID: 6321185
Thanks Zvonko
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6322416
Hello saleem,

thank you for the points ;-)

But I would be interested in the feedback: did you realise my proposal to embad the a copy of html produced by the navigator into a Notes page?

...by the way: you need not to import the navigator gif/jpg; only the navigator html.
0
 

Author Comment

by:saleemkhan
ID: 6322598
thats i didnt understand.u said if i gave 300 points also it is somewhat complicated.thats why i left.
if u help me in that how it see the navigator html or how to proceed.
 i know just created a navigator in open browser then view source.
any other way.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6323942
no other way. exact wath I mean.

Now, cut and paste this html into a Notes page.
Mark the page property: "TreatPageContentsAsHtml"

In place where you embedet the navigator embed the created page. Test for the correct cals. For first nothing changed. You should see the same navigator like without the page. BUT now you can modificate the navigator html code!!! (You see ;-))


(...in any case I have nothing against extra points <|;-))
0
 

Author Comment

by:saleemkhan
ID: 6329317
hello zovnko,
  Thans very much for ur kind response.As per ur hint i tried its working but its creating the button as well as the hotspot button.
 if i click on hotspot button it going to mail file working fine.if it is minimized i have to click on the java script button(new) which u helped me.
 so what i want is i want to click on only one button if its is mimized it should be maximized if its max it should be like that.
 so here is the code just check and help me.

<HTML>
<!-- Lotus-Domino (Release 5.0.8 - June 18, 2001 on Windows NT/Intel) -->
<HEAD>
<BASE TARGET="saleem"><TITLE>NavMain</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
document._domino_target = "saleem";
function _doClick(v, o, t) {
  var url="/QnetTest.nsf/NavMain?OpenNavigator&BaseTarget=saleem&Click=" + v;
  if (o.href != null)
    o.href = url;
  else {
    if (t == null)
      t = document._domino_target;
    window.open(url, t);
  }

}
// -->
</SCRIPT>
</HEAD>
<BODY TEXT="000000" BGCOLOR="FFFFFF">

<MAP NAME="132.map">
<AREA HREF="http://saleem/QnetTest.nsf?logout" SHAPE=rect COORDS="25,305,139,338">
<AREA HREF="http://saleem/QnetTest.nsf/saleemloginfax?openagent" SHAPE=rect COORDS="19,268,133,301">
<AREA HREF="http://saleem/stcenter.nsf" SHAPE=rect COORDS="19,232,133,265">
<AREA HREF="http://saleem/stcenter.nsf" SHAPE=rect COORDS="16,199,130,232">
<AREA HREF="http://saleem/QnetTest.nsf/saleemmailloginNotebook?openagent" SHAPE=rect COORDS="14,164,128,197">
<AREA HREF="http://saleem/QnetTest.nsf/saleemmaillogincontact?openagent" SHAPE=rect COORDS="14,130,128,163">
<AREA HREF="http://saleem/QnetTest.nsf/saleemmailloginTodo?openagent" SHAPE=rect COORDS="14,96,128,129">
<AREA HREF="http://saleem/QnetTest.nsf/saleemmaillogincal?openagent" SHAPE=rect COORDS="14,62,128,95">
<AREA HREF="http://saleem/QnetTest.nsf/saleemmaillogin?openagent" SHAPE=rect COORDS="16,25,130,58"></MAP>
<A HREF="/QnetTest.nsf/031ee19749b05e3b43256a8a004bf051?OpenNavigator"><IMG SRC="/QnetTest.nsf/031ee19749b05e3b43256a8a004bf051/$NavImagemap/0.52?OpenElement&FieldElemFormat=gif" WIDTH=140 HEIGHT=339 USEMAP="#132.map" BORDER=0 ISMAP></A></BODY>
</HTML>

<script language="javascript">
var the_window = null;
function test()
{
if(!the_window  || the_window .closed)
{
the_window  = window.open('http://saleem/QnetTest.nsf/saleemmaillogin?openagent','tie','left=30,top=200, width=500,height=600,toolbar=0,resizable=0,scrollbars=0,status=0,menubar=0,directories=0,location=0');
 return false;
}
else
{
 the_window.focus();
}
}
</script>
<input type=button onclick="test()" value="new">

can u help me.i think i have done a small mistake as i did last time.
waiting for  reply.
saleem.

0
 
LVL 10

Expert Comment

by:zvonko
ID: 6539839
Sorry saleem,
I have not seen you last post here.

Have you solved this on your own, or do you need some support?

Regards,
zvonko
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lotus Notes 41 197
IBM Enterprise Integrator - ZID File 1 173
Send email lotus notes / VBA 6 171
Unable to change external email address in Lotus Notes Mailbox 11 78
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…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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