Problems using window.close() and setting fields

Hi,
I have two problems:
First one is:
I created a simple JSP with 'Save' and 'Exit' Buttons. In the Exit button on click event I invoked a function closeWindow, which calls teh window.close(). But on clicking Exit, the window does not close. Can anyone please tell me why.
Second one is:
The JSP also needs to get loaded with some values in the Textfields. Theses values are extracted from a text field using a Java class. I am able to see that these values are extracted from the text file and are loaded into Java vars, but when I am trying to set this value into a text field, it is NOT getting set.
(filePathDetails is the instance of the class that extracts the text values)
The entire code is posted below:
<%@ page language="java" import="ftpScheduler.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<% FolderPathInfo filePathDetails = new FolderPathInfo(); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>PATH DETAILS</title>
    <SCRIPT type="text/javascript">
     function setPaths(){
          with(document.pathDetails){
               textAncPath1.value = <%=filePathDetails.localDirPath1 %>;
               textAncPath2.value = <%=filePathDetails.localDirPath2 %>;
               textArchivePath.value = <%=filePathDetails.archiveDirPath %>;
               textLogPath.value = <%=filePathDetails.logFilePath %>;
     function closeWindow(){
          window.closeWindow();
    </SCRIPT>
</head>
<body bgcolor="#c0c0c0" onload="setPaths()">
     <FORM name="pathDetails" method="get" action="DetailsServlet.java">
     <FONT face="Arial" size="3"><STRONG>Directory Paths:</STRONG></FONT>
       <BR><BR>
       <TABLE border="0" cellspacing="" height="60" width="450"
                                                    style="FONT-SIZE: 10pt; FONT-FAMILY: Arial" align="center">
       <COLGROUP>
       <COL width="45%">
       <COL width="55%">
       </COLGROUP>
       <TR>
       <TD><LABEL>Ancillary Transmit Path1 :</LABEL></TD>
       <TD><INPUT type="text" name="textAncPath1" width="290" maxlength="350"/></TD>
       </TR>
       <TR>
       <TD><LABEL>Ancillary Transmit Path2 :</LABEL></TD>
       <TD><INPUT type="text" name="textAncPath2" width="290" maxlength="350"/></TD>
       </TR>
       <TR>
       <TD><LABEL>Archive Path :</LABEL></TD>
       <TD><INPUT type="text" name="textArchivePath" width="290" maxlength="350"/></TD>
       </TR>
       <TR>
       <TD><LABEL>Log File Path :</LABEL></TD>
       <TD><INPUT type="text" name="textLogPath" width="290" maxlength="350"/></TD>
       </TR>
       </TABLE>
       <P align="center">
          <INPUT type="submit" name="buttonSave" value="Save">
          <INPUT type="button" name="buttonExit" value=" Exit " onclick="closeWindow()">
          <BR>
       </P>
       </FORM>
</body>
</html>Please help me.
Thanks in advance.

Try the following..
For problem 1:
Use window.close() instead of window.closeWindow().
For the second problem
don't call the function setPaths() at onload. Rather
call the function after the page is loaded. You can
try like this.
If it doesn't work then check whether the browser is
giving any JavaScript error message.
<SCRIPT type="text/javascript">
setPaths() ;
     function setPaths(){
     alert(document.pathDetails.element[0].value);
document.pathDetails.element[0].value =
= <%=filePathDetails.localDirPath1 %>;
          alert(document.pathDetails.element[0].value);
          with(document.pathDetails){
textAncPath1.value =
e = <%=filePathDetails.localDirPath1 %>;
textAncPath2.value =
e = <%=filePathDetails.localDirPath2 %>;
textArchivePath.value =
e = <%=filePathDetails.archiveDirPath %>;
textLogPath.value = <%=filePathDetails.logFilePath
ath %>;
     function closeWindow(){
          window.closeWindow();
</SCRIPT>Hi,
Actually I did try window.close(), but I still am not able to close the current window.
And as for the problem of setting up the field values, sorry the given solution doesnt seem to work. :-(..
I have pasted the entire code, I dont know where teh flaw is. Please review the same and let me know.
Your help is very much appreciated.
<%@ page language="java" import="ftpScheduler.*" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<% FolderPathInfo filePathDetails = new FolderPathInfo();%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>PATH DETAILS</title>
     <SCRIPT type="text/javascript">
     function setPaths(){
          document.pathDetails.textAncPath1.value = "Anything";
          with(document.pathDetails){
               textAncPath1.value = <%=filePathDetails.localDirPath1%>;
               textAncPath2.value = <%=filePathDetails.localDirPath2%>;
               textArchivePath.value = <%=filePathDetails.archiveDirPath%>;
               textLogPath.value = <%=filePathDetails.logFilePath%>;
     function exitWindow(){
          window.close();
    </SCRIPT>
</head>
<body bgcolor="#c0c0c0">
     <FORM name="pathDetails" method="get" action="/FTPSchedulerApp/ftpScheduler/DetailsServlet.java">
     <FONT face="Arial" size="3"><STRONG>Directory Paths:</STRONG></FONT>
       <BR><BR>
       <TABLE name="tempTable" border="0" cellspacing="" height="60" width="450" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial" align="center">
       <COLGROUP>
       <COL width="45%">
       <COL width="55%">
       </COLGROUP>
       <TR>
       <TD><LABEL>Ancillary Transmit Path1 :</LABEL></TD>
       <TD><INPUT type="text" name="textAncPath1" width="290" maxlength="350"/></TD>
       </TR>
       <TR>
       <TD><LABEL>Ancillary Transmit Path2 :</LABEL></TD>
       <TD><INPUT type="text" name="textAncPath2" width="290" maxlength="350"/></TD>
       </TR>
       <TR>
       <TD><LABEL>Archive Path :</LABEL></TD>
       <TD><INPUT type="text" name="textArchivePath" width="290" maxlength="350"/></TD>
       </TR>
       <TR>
       <TD><LABEL>Log File Path :</LABEL></TD>
       <TD><INPUT type="text" name="textLogPath" width="290" maxlength="350"/></TD>
       </TR>
       </TABLE>
       <div align="center">
          <INPUT type="submit" name="buttonSave" value="Save"/>
          <input type="reset" name="buttonReset" value="Reset" onclick="setPaths()"/>
          <button name="buttonExit" onclick="exitWindow()"> Exit </button>
          <BR>
       </div>
       </FORM>
</body>
</html>

Similar Messages

  • Problem with window.close and window.open

    I am having two suspected Actionscript problems which only seem to be happening with Flash player 9 and later.
    BACKGROUND:
    I have a client who needs browser-launched swf files to play from a CD-ROM (I do not want to use the Flash projector).  These files were created a few years ago using Actionscript 1 & 2 code and everything has worked perfectly until now.
    Here is the setup:
    First, an autorun file on the root of the CD runs and writes a 'trust file' to the 'Macromed' directory.  The autorun next launches 'index.htm' which is simply an html page containing a series of links (topic1.htm; topic2.htm; and so on). Next, let's assume the student clicks the 'topic1.htm' link from the 'index.htm' page.  The 'topic1.htm' link launches a web page (also located on the CD) which contains and displays 'topic1.swf'.  So far, everything works fine.
    Here is where the two problems happen.
    Problem 1:
    I have an 'Exit' button within each swf (remember each swf is contained inside an html page).  The 'Exit' button has always worked properly, but suddenly does not work in Flash player 9.  I am using the following Actionscript 2 code on the 'Exit' button:
    on (release) {
    getURL("javascript:window.close()");
    The 'Exit' button has always worked using this code (and still works in Flash player 8 and lower).  However, it does nothing when played using Flash player 9.
    Problem 2:
    There are links to html popup windows within the 'topic1.swf' file (remember 'topic1.swf' is contained inside 'topic1.htm').  Each popup window contains a swf file that is used to present a demonstration.  When the student clicks the 'demo1.htm' link from 'topic1.swf', an html popup window SHOULD load and display 'demo1.swf' inside the 'demo1.htm' window.  The main ('topic1.htm') window stays open so that the student can return to the topic after completing the demo.  This has always worked properly until Flash player 9.  Here is the Actionscript 2 code
    which I am using on the button inside 'topic1.swf' to launch 'demo1.htm':
    on (release) {
                getURL("javascript:launchWin2('webpage2.html');");
    ADDITIONAL INFO:
    'topic1.htm' contains the following code which is used to support the Actionscript code listed under 'Problem 2' above.
    <SCRIPT LANGUAGE=JavaScript>
    <!--
    var padvar="";
    var childwind;
    function launchWin2(arg) {
    openWin2(arg);
    function openWin2(arg) {
    childwind = window.open(arg,"padwind2","menubar=no,location=no,status=no,scrollbars=no,width=750px,he ight=500px,left=0,top=0");
    //-->
    </SCRIPT>
    I would appreciate any help anyone can offer.  I am wondering if the problem has to do with a need to use ONLY Actionscript 3 code from Flash player 9 onwards.
    Thanks!
    Terry

    You may have '''Switched ON Caret Browsing'''. press '''F7 (on Mac: fn + F7)''' to toggle '''Caret Browsing ON/OFF'''
    * click '''Firefox''' button and click '''Options''' -> Advanced -> General -> remove
    Checkmark from '''Always use the cursor keys to navigate within pages'''
    * http://kb.mozillazine.org/Scrolling_with_arrow_keys_no_longer_works
    * http://kb.mozillazine.org/Accessibility_features_of_Firefox
    Check and tell if its working.

  • Problem with window.close() and print preview in IE

    Hi all,
    In IE, when window.close() or self.close() is executed, the window is closing perfectly. But when after opening a print preview window from file menu in IE and after closing the print preview with [X] button, then the window.close() is not working. Is there any solution to close the window even after closing the print preview window? here is the sample code.
    1) Close.htm
    <HTML>
    <TITLE>TEST</TITLE>
    <BODY>
    <SCRIPT LANGUAGE="javascript">
    function CloseMe()
    window.close();
    //self.close();
    </SCRIPT>
    <INPUT TYPE="button" ONCLICK="CloseMe()" VALUE="Close Me">
    </BODY>
    </HTML>
    Thanks,

    masijade. wrote:
    nogoodatcoding wrote:
    Crosspost: http://forum.java.sun.com/thread.jspa?threadID=5227849&tstart=0
    Why'd you start a new thread once you got an answer on the thread linked above ( and even acknowledged it ) about the fact a that it was not a Java query?Because last time it was a JSP forum, which is not JavaScript obviously, but this is a Java forum, and the designers, obviously, simply neglected to include Script in the name, of course. ;-):D Why, oh, why did they have to call it JavaScript! (And before someone starts, that was a rhetorical question!)

  • Scanner problems using windows 8 and canon pixma mx432. printer is set up but wont scan

    I have my printer installed on my computer already but the scanning function is not even coming up to be able to use it. I recently was given a new computer and it has windows 8 on it. it took a lot to get it to even be installed on the computer but the scanner portion won't work. When I bring it up it has the section where the scanner should be but nothing is there to push. What can I do to get this function working correctly?

    All the drivers for 4350D and MF4690 and a few more models I owned in a few more offices have the scanner bug in the drivers for Windows 8. No new drivers been released to fix the problem all those scanners I owned have. Now Canon just put the Windows 8_Notice_ENG inside the driver package and includes the [Limitations During Operation] that says:
    When using the scan function while the device is connected to a computer by USB, removing the USB cable and then
    plugging it back in or turning the device off and then on will cause the scanning function to be unable to execute. If this
    occurs, please restart the computer.
    Seriously, Canon? Restart the computer everytime it doesn't work, and I have to go through the hazzle saving all the files I am working on just to restart to get the scanner to work? I have tried to mod the newer drivers for MF4770n and a few new models to make it work with those 4350D 4690 models, it will then detect the scanner without restart, but the scanner won't produce a readale image using my modified drivers. Now stick with VM Player running Windows 7 to scan the files with those old scanners. I won't buy another Canon scanners for my future needs if Canon just can't fix the Windows 8 driver problems all those scanners I owned.

  • I just factory restored my iPod 5 touch and when I plug it into iTunes to restore the back up I made, iTunes becomes unresponsive and closes. But when I unplug the iPod, it starts working again. Using Windows 8 and iTunes is updated, please help.

    I just factory restored my iPod 5 touch and when I plug it into iTunes to back it up, iTunes stops responding and closes. This only occurs when the iPod is plugged in, when it isn't, iTunes works fine. I am using Windows 8 and iTunes is updated (as of this posting). Any suggestions on getting around this? Thank you.

    Also, when I put it through the Windows diagnostic, it lists an "incompatible program" WHILE my iPod is plugged in.

  • Using windows 8 and trying to install photoshop cs6 but keep getting message to close cs5 bridge

    using windows 8 and trying to install cs6 but keep getting message to close adobe bridge cs5 which I do not have open. Is this a bug in windows 8???

    bridge.exe is probably running in the background. Trying closing it via the Task Manager.
    See http://helpx.adobe.com/creative-suite/kb/error-installation-cannot-continue-bridge.html

  • I am thinking of buying a iPad but my main desktop machine uses Windows 7 and MS Office.  How easy or difficult is it to transfer data files between the iPad and Windows?  Are there obvious problems or the need for some form of conversion programs?

    I am thinking of buying a iPad but my main desktop machine uses Windows 7 and MS Office.  How easy or difficult is it to transfer data files between the iPad and Windows?  Are there obvious problems or the need for some form of conversion programs?
    Many thanks for any advice.
    David

    You don't need conversion programs, iTunes can copy most of your content over to the iPad via the file sharing section, and some apps also support Dropbox, email attachments, transfer via your wifi network. There are a number of apps that you can get that support Microsoft office file (microsoft don't make an app versions of their software) e.g. from Apple there are Pages (word support), Numbers (excel) and Keynote (powerpoint), and from third-parties there are apps such as Documents To Go and QuickOffice HD

  • Acrobat reader installed fine, but opens for five seconds and then closes. Using Windows 7 and mcafe

    Acrobat reader installed fine, but opens for five seconds and then closes. Using Windows 7 and McAfee on a Dell laptop.

    You can try using Windows Explorer to navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement

  • Using Windows 8 and can't authorize my computer to upload apps and play music on my new laptop.  What do I need to do to fix problem.

    Using Windows 8 and can't authorize my computer to upload apps and play music on my new laptop.  There is no "authorize computer" in a drop down menu as suggested in iTune store or its support page. What do I need to do to fix problem?

    MY personal thinks to Radez29. Yes, it is now authorized. BUT, I have an obvious question and an obvious statement.
    Question......why, in my many emails to/from Apple support, was this simple solution not given to me?
    Statement.......Apple should consider "terminating" the present employees and hiring Radez29. He obviously knows a LOT more than the Apple support team.
    AGAIN, my sincere thanks to Radez29 for this solution.
    Ron

  • I am using Windows XP and just installed Elements 12. When I try to select a different brush or shape the drop down list will not stay open long enough to select a different item. I have used Elements 9 for awhile and have not had this problem

    I am using Windows XP and just installed Elements 12. When I try to select a different brush or shape the drop down list will not stay open long enough to select a different item. I have used Elements 9 for awhile and have not had this problem

    grannybel
    It would appear that you are destined for the Adobe Photoshop Elements Forum since your question is related to Photoshop Elements and not Premiere Elements which is the focus program where you have posted.
    But, while the arrangements are being made, here are a few things for you to think about if you have not already
    1. Reset Tools - Select Brush Tool, then
    2. Delete Settings File
    Go to Full Editor/Edit Menu/Preferences/General and click on the option "Reset Preferences on Next Launch".
    We will be watching for your progress.
    Thank you.
    ATR

  • Using windows vista and all the graphics i create the colours look blurry?

    Hi everyone,
    I have just started using windows vista and i have noticed
    that when i create graphics using fireworks 8 that when i view them
    either on dreamweaver 8 or just using the windows viewer that the
    graphics and colours in the graphics look very blurry?? Does anyone
    know why this should be? As i was creating graphics successfully
    before with fireworks 8 when i was using windows xp and had none of
    these problems at all.
    Any advice would be most welcome.
    Many thanks,
    Gordon.

    Fireworks is not compatible with Aero. So, whenever you start
    Fireworks,
    Vista will warn you that Areo will not work and to use
    Fireworks you must
    disable it. Once you close Fireworks, Vista will
    automatically re-enable
    Aero. Obviously not a huge issue, but it is kind of annoying
    for the screen
    to flicker and lose all your pretty eye candy every time
    Fireworks starts.
    "Gordonuk" <[email protected]> wrote in
    message
    news:g6ithu$3eb$[email protected]..
    > Hi everyone,
    >
    > I have just started using windows vista and i have
    noticed that when i
    > create
    > graphics using fireworks 8 that when i view them either
    on dreamweaver 8
    > or
    > just using the windows viewer that the graphics and
    colours in the
    > graphics
    > look very blurry?? Does anyone know why this should be?
    As i was creating
    > graphics successfully before with fireworks 8 when i was
    using windows xp
    > and
    > had none of these problems at all.
    >
    > Any advice would be most welcome.
    >
    > Many thanks,
    > Gordon.
    >

  • TS1538 I am using windows 7 and my 3rd gen nano is not recognized in itunes. I have followed all online troubleshooting to no avail. My ipod is recognized by windows but does not appear in itunes.

    I am using windows 7 and my 3rd gen nano is not recognized in itunes. I have followed all online troubleshooting to no avail. My ipod is recognized by windows but does not appear in itunes.

    not recognized by anything: http://support.apple.com/kb/TS1369
    recognized by windows, but not itunes: http://support.apple.com/kb/TS1363
    solving the problem if the above does not work:http://www.instructables.com/id/What-to-do-when-iTunes-does-not-recognize-your-i Po/step1
    (make sure you go to the next slides.

  • I am using windows 7 and itunes 11.7 my i phone 5s is not getting synced with my laptop it keeps showing backing up  please help i need to put music in my phone?

    i am using windows 7 and itunes 11.7 my i phone 5s is not getting synced with my laptop it keeps showing backing up  please help i need to put music ?

    Hi,
    Have you managed to solve this problem? if yes, please highlight how you solved it...i'm facing same problem with my new Iphone 5S but udner Windows, thanks.

  • I'm using windows 7 and working in office 2010. I have installed iCloud and I can't print my calendar from outlook all it will print is a blank calendar no appointments or birthdays . can anyone help please.

    I’m using windows 7 and working in office 2010. I have installed iCloud and I can’t print my calendar from outlook all it will print is a blank calendar no appointments or birthdays . can anyone help please.
    Geoff

    I had a similiar problem, with my multiple devices.  I open iTunes and when all devices were connected I went to the info section on each device.  Under info I checked the sync calandars. Under that I click all calanders. I then did the apply in low right. I then did the sync function and it fixed it for me.  You have to do this for each device.
    I also checked the device (ipad,Iphone) themselves and change the calander selection to NO Catagory.  Hope this helps.

  • Webcam on Satellite A500 using Windows 7 and Windows Live Messenger 2009 (14.0.8089​.726)

    Hello. This is my very first post and maybe I can find a resolution to the problem. Thank you for taking the time to read this and thank you if you can assist me in resolving the problem.
    I recently upgraded from Windows Vista Home Premium to Windows 7 Home Premium using the Windows 7 Upgrade Media that was sent to me for my Toshiba Satellite A500. The upgrade loaded successfully. My laptop already had the Windows Live (MSN) Messenger on it when I was using Windows Vista and the webcam worked okay then. Now with Windows 7, when I try to do a voice/video chat using the Windows Live (MSN) Messenger version 2009 (Build 14.0.8089.726), my built-in laptop webcam does not work. When I initiate a voice/video chat, all I get is a big red X next to the webcam icon in the little view area window when it attempts to run. I can receive voice/video from people using MSN Messenger but my laptop can't send out any video. My laptop sends out voice but no video. I un-installed the Messenger, rebooted and re-installed it but it still won't do video output.
    Interestingly, when I tried doing a voice/video chat with Gmail, my webcam worked. I haven't tried Yahoo yet. My webcam worked fine before upgrading to Windows 7. I suppose I could just forget about MSN Messenger and use Gmail but not all my contacts use Gmail. I'd like to be able to continue using MSN Messenger if possible.
    So I'm posting here to see if there is any resolution or suggestions I can have to get my webcam working with Windows Live (MSN) Messenger. Not the end of the world if I can't make it work again.
    Have a nice day. Regards,
    Doug 

    this is the latest version of youcam http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-68857-1&lc=en&dlc=en&cc=us&...

Maybe you are looking for

  • Laserjet pro MFP M176n keeps rebooting

    Hi, I have  a Color laserjet Pro MFP M176n printer. It ha snot been used for sometime.2 weeks ago when I printed something it had constant paper jam. I open the front door to remove the jam problem was not solved, I removed the ink cartridge to see i

  • Invoicing Plan Net Value not equals to Ordered Value

    Dear Xperts, Need your advice. Is it SAP standards, when an invoicing plan BPO is created with reference to an outline agreement the net value at the outline agreement (header statistic) is taken from the BPO net value (Quantity X Price) NOT BPO orde

  • ESYU: Order Import를 통해 기존 Order를 reference 하는 RMA Order를 생성하는 방법

    Purpose Oracle Order Management - Version: 11.5.9 to 12.0.5 Information in this document applies to any platform. Order Import를 통해 기존 존재하는 Order를 reference 하는 RMA Order의 생성 방법을 알아본다. Solution Order Import interface의 header와 line에 data를 insert 하기 위해 아

  • A SSP  ticket was received and can't be interpreted

    Hi All, We are trying to .NET use Authentication features in EP Portal. Here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/edb8a190-0201-0010-d398-c23e34f30295#_header1_2 it's said that you can use portal SSO to connect wi

  • Converting PDF files

    A client of mine has a company logo in the form of a pdf document. We were just wondering if there was a way to convert the PDF to a jpg or png file format. Any help would be greatly appeciated for our video to music conversion site. [ link removed b