javascript problem

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.
saleemkhanAsked:
Who is Participating?
 
zvonkoCommented:
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
 
zvonkoCommented:
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
 
zvonkoCommented:
you see the blank in: the_window .closed
why does this work? ;-)

...anyway: great!
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
saleemkhanAuthor Commented:
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
 
zvonkoCommented:
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
 
saleemkhanAuthor Commented:
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
 
zvonkoCommented:
you missed the () in function call ;-)

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

good luck,
zvonko
0
 
saleemkhanAuthor Commented:

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
 
zvonkoCommented:
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
 
saleemkhanAuthor Commented:
Thanks Zvonko
0
 
zvonkoCommented:
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
 
saleemkhanAuthor Commented:
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
 
zvonkoCommented:
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
 
saleemkhanAuthor Commented:
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
 
zvonkoCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.