Open and Close Popup With Javascript

Using Apex 3.2
I have probably done this loads of times in my old job, but do not have access to the code and today I just can't get it to work properly.
I have opened a pop up window with javascript
Now I need to close it and refresh the calling page, but only if it passes the validation on the popup.
I have a hidden item on my pop up called P7_FLAG.
I have a page process after validation that sets P7_FLAG to (only set to 1, if passes validation).
I also have a SUBMIT button.
So once I click my SUBMIT button the page should look at the validations, if ok, set P7_FLAG to 1, then close the popup and refresh the calling page.
My current javascript look like this
<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
var test = $x('P7_FLAG').value;
if(test == '1')
window.close();
window.opener.doSubmit('REFRESH');
</script>On my button
javascript:saveChanges();The problem is that I need to click the SUBMIT button twice.
First time it sets P7_FLAG
Second time it closes page and refreshes.
I have probably made some basic error, but today I cannot see it.
Cheers
Gus
Edited by: Gus C on May 10, 2012 12:48 AM

<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
var test = $x('P7_FLAG').value;
if(test == '1')
window.close();
window.opener.doSubmit('REFRESH');
</script>javascript does not wait for the current action to complete and then perform the next line.
means in your function call
doSubmit('SUBMIT');is triggered and it carry on's to next line that is
$x('P7_FLAG').value;this will not be set because you are setting the value of P7_FLAG to 1 in plsql and trying to check in javascript, which will not work.
what you need to do is amend your js function like below
<script type="text/javascript">
function saveChanges(){
doSubmit('SUBMIT');
</script>create a page branch to procedure and make it conditional to when P7_FLAG = 1
and set the branch source to below
htp.p('window.close();');
htp.p('window.opener.doSubmit(''REFRESH'');');

Similar Messages

  • Why can't I open and close tabs with scroll, after updating to Firefox 10???

    I updated my Firefox, and opening or closing tabs whit scroll button doesn't work any more.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    Your Firefox 9.0.1 is not the latest version anymore, so please update to the latest Firefox 10.0.x version via Help > About Firefox.

  • How to automatically open and close collapsable spry panels?

    I designed a collapsable spry panel in DW to open and close automatically, with a 10 sec delay, unless person clicks on tab to close immediately.
    The spry panel opens automatically, but will only close if i click the tab.
    Is there a way for the collapsable spry panels to close automatically?
    [Moved to Spry forum by moderator]

    Arnout,
    I feel certain the answer I need is in the reply you posted here, but I need a little more help to know exactly what to do.  I am using a collapsible panel to show and hide a series of onload panoramic photos near the top of my page.  What I want is for the collapsible panel to be open on some pages and closed on others and I want the animation of the panel closing to be seen too.  I'm thinking this should be achievable with some sort of onload trigger or something.  Currently I've gotten close to what I want by referencing two different .js files (one for the "open" panel state and another for the "closed" panel state), but this doesn't show the graceful animation of the panel closing.  Any ideas on how to achieve what I want?  Here is the url of the test site I'm developing:  http://www.gregdanpartners.com/lrre2/index.html
    Thanks in advance.
    Dan

  • Open and close multisim contact with LabVIEW

    Can I open and close multisim contact with labview and read the receptor estatus (p.e. lamp)?
    Thanks.
    Attachments:
    Dibujo.JPG ‏13 KB

    Hi Guddan,
    I created a RFC having a query which is taking a long time to execute. So i want to close RFC connection with portals which is via java connector(JCO) before that query and open the connction again after that query.
    I guess i will need to understand your requirement a little more in detail, as i understand you have an RFC which has a query within to fetch some data and is taking a long time to do so. In the meantime you don't want to keep the connection open?
    My question would be, Is the role of this RFC to only execute the query and fetch the data or does it do something else?
    If it does other things and these are independent of the query execution, then you can span a parallel call within the RFC to execute the query and in the meantime the RFC does the other things (or vice versa) hence reducing the overall time taken.
    If the sole purpose of this RFC is to execute the query, then you will not be able(i mean to say there is no simple and direct way of doing this) to close the connection after the Query is started and re-establish the connection after its execution, for a simple reason that - how will you know if the query has completed it's execution, so that you can establish the connection back.
    Alternate solutions, make this a two way asynchronous call, 1) You invoke the RFC asynchronously and close the connection, the RFC in turn will execute the query and transfer the data to JCO via another RFC call.
    If this needs to be a synchronous call, then you will need to optimize the query to its best.
    Regards,
    Chen

  • It's better or necessary open and close communicat​ion with instrument every loop?

    I must communicate with my instrument, but I must change its value, for example temperature, every loop. See the Figure to understand:
    I think that it is better if I open communication with my instrument out of while loop so I many operation: if I put Open VISA in While loop I open VISA session every loop, instead I think it is not intelligent. Can I open VISA SESSION out of the while loop or it is an error for EXCELLENT LABVIEW VI and I must open and close VISA SESSION every times I must talk (and set) with instrument? What is the better way?
    Message Edited by Michelle1892773 on 02-22-2010 02:00 PM

    Something like this?
    I do have to say, i don't know what is happening in the false case of yours, but if nothing happens with the 100 that is wired to the shift register, once you enter the true case, the value in the shift register will always be great than "i". You might as well do what I have done then. However, if something does happen with that number in your false case, then keep it the way you have it.
    That being said, why is the condition there to see if it has looped 100 times before doing the visa write??
    Message Edited by for(imstuck) on 02-22-2010 04:45 PM
    Message Edited by for(imstuck) on 02-22-2010 04:46 PM
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    visa.PNG ‏13 KB

  • Pages 09 document; open and close many times; right way with Lion?

    I have a 106 page document that increases in size on a daily basis. With OS 10.7, iWork/Pages 09 on my new, iMac, it's common that I lose as much as two sentences after the document is closed and re opened. After 10.7 was installed the document was closed using Command - S, and subsequently closed by pulling down File and selecting Close. - Not the way to close; the red button was so easy with 10.6. IS UNINSTALLING LION THE BEST SOLUTION?
    And yes, I've read the sorry jibberish in the Pages 09 manual - which doesn't say how to open and close repeatedly a document with Pages 09.
    So, with the Lion - the worst ever of spending $30, is it necessary to do a Command S every time you close? And what exactly is necessary each time you close a document using Pages 09 and Lion? - And about Auto Save; well, what about Auto Save? - The Lion means well for something other than common, understandable, text production.  -- How about a separate application of Appleworks for text producers like me?

    The red button is always available under 10.7 (or 10.7.1)
    Under 10.7, press cmd + S once when you create the document.
    After that, the system automatically save your changes.
    No need for cmd + S.
    To close the document we may use :
    the red button
    cmd + W
    File > Close
    as it was with older systems.
    monte45 wrote:
    And yes, I've read the sorry jibberish in the Pages 09 manual - which doesn't say how to open and close repeatedly a document with Pages 09.
    The User Guide is perfectly clear and precise :
    Yvan KOENIG (VALLAURIS, France) jeudi 22 septembre 2011 19:21:52
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Hello  I have a problem with Mac Pro, iPhoto does not want to stay open and close as I can figure this out?  thanks

    Hello  I have a problem with Mac Pro, iPhoto does not want to stay open and close as I can figure this out?  thanks

    Refer below link once
    App doesn’t open | Progress wheel spins continually

  • I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch.

    I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch, it Should be having so much problems. Thanks for your help.
    iPad, iOS 7.0.4

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Track pad pinch open and close not working with Firefox 4

    the pinch open and close feature to adjust size on my Mac track pad does not work

    Some mouse gestures have been removed in Firefox 4.
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    browser.gesture.pinch.in cmd_fullZoomReduce
    browser.gesture.pinch.in.shift cmd_fullZoomReset
    browser.gesture.pinch.out cmd_fullZoomEnlarge
    browser.gesture.pinch.out.shift cmd_fullZoomReset
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    * http://kb.mozillazine.org/about%3Aconfig

  • Motion 4: open and close a group with key shortcut?

    Mo4: Layers window: any shortcut to twirl down (and/or up) all the layers in a group? Or layers in layers? The manual says arrow keys move from group to group,layer to layer and that works... also says that L & R keys open and close selected group/layer, my LR arrow keys don't do anything...
    Thanks, John

    No, actually you do not - you need to click the helpful or solved buttons over their post in order to give them credit.
    And what you do by assigning a helpful or solved (helpful is 5 points, solved is 10) is to build their reputation here. Not a bad thing to do for those who help you...
    Patrick

  • Trackpad playing up and windows open and close with out me doing any thing

    Hey since updating to OS X Mountain Lion 10.8.5
    my Mac has been playing up. I can't really control the mouse anymore
    it basically goes where it wants to go. Also my Mac started to open and close Windows on its one,
    switching back and forth between sides, as well as opening mission control and other things.
    It is impossible for me to use my Mac at the moment :
    Would be grateful for any tips on how to fix it !!!
    Thanx

    Try the troubleshooting help here > Portables and Magic Trackpad: Jumpy or erratic trackpad operation

  • Playbook opens and closes apps randomly, constantly

    I have a 32gig playbook that all of a sudden has gone haywire. The screen goes nuts like someone is inside playing around, apps open and close randomly to the point I can't do anything. I've tried reseting, 3 button reset, managed to do a security wipe but nothing helps. It does it if its plugged in charging or not, I've looked through a few posts and this seems to happen for time to time but very few people have posted any solution. I will try to reinstall the OS when I get home but with the thing going haywire I'm not sure I can get it to connect to do that. Is there any solution to this? What caused it?

    Here is the procedure. Read it over first, then do it.
    You need to follow these instructions to "debrick" your PlayBook:
    1. Do a backup of your PlayBook using your computer and BlackBerry Desktop Software version 7 installed. It can be downloaded from http://us.blackberry.com/apps-software/desktop/
    2. After the backup is finished, unplug the PlayBook and on the PlayBook press and hold down the power button until the unit forces the device off.
    3. With the Desktop Software still open on your computer and the PlayBook powered off, connect the PlayBook to your computer once again.
    4. You should see an error screen from Desktop Software popup with the options to Retry, Update, or Cancel.
    Very quickly choose the Update option.
    5. All information will on your PlayBook will be erased and a reload of the Software will commence to install on the PlayBook.
    6. Once this is complete your PlayBook will go back through the initial (as if new) setup wizard (entering the BlackBerryID, etc., and then you can perform a restore using Desktop Software to return your personal data from the backup. Applications which you downloaded from AppWorld won't restore, but they can be easily reinstalled using AppWorld > MyWorld section of AppWorld.

  • Find open and close smart quotes

    Dear scripter,
    Here I am trying find whether all the open double smart quotes(") are closed with close double smart quotes("). Here is my small work to find how many open and close quotes.
    myopenqu=app.activeDocument.search("^{", false, false, "^{");
    myclosequ=app.activeDocument.search("^}", false, false, "^}");
    myopenqulength = myopenqu.length;
    myclosequlength = myclosequ.length;
    if(myopenqulength!=myclosequlength)
    alert("Quotes not matched\n"+ myopenqulength +" Open quotes found\n" + myclosequlength +" Close quotes found")
    It works well, the script just alert if I have 25 open quotes and 23 close quotes
    Quotes not matched
    25 Open quotes found
    23 close quotes found
    Now I want to find the quote set where the 24,25th set close quotes are missing?
    Is there any way to find the misisng quotes
    Thanks in advance
    regards
    a r u l
    vpublish.net

    You'd have to look for unmatched quotes, in this case two cases of two open quotes without an intervening closed quote. This is difficult to script in CS2 because it doesn't have GREP natively and because of footnote problems. In CS3/4 it should be possible. But even then it will work only if you don't have quotes within quotes.
    Peter

  • Report OPEN and CLOSE in computers client

    Post Author: B.prata
    CA Forum: Crystal Reports
    I have an application developedin Visual Basic with report in the CR 4.6, but in the computers customers when I will access the application,I try to emit a report , it opens and close the report. What can be?

    There is no FaceTime app for the iPhone if that's what you're asking.  FaceTime is accessible through your Contacts as one of the options in how to contact a person -- there is no standalone FaceTime app for iPhone.
    If you mean how to disable FaceTime, you can do that in Restrictions (Settings/General/Restrictions).

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

Maybe you are looking for

  • How to find a word written with two fonts...?

    Hi, I have a 200+ pages document that contains some words with the first letter in Times regular and the rest in Times italic. Is there any way to find those words in the document? Thanks

  • Ipod wont turn on or RESTART

    My one week old new 80g ipod classic the other day was plugged in simply charging and syncing the screen suddenly turned white, then went back to black and now it wont turn on and everyone says to restart but it wont restart (i know im doing it right

  • Mail crashes on launch after Leopard 10.5.2 update

    I upgraded my Al PB G4 1.67 GHz to Leopard last week. I like Leopard's new features, but have had my share of bugs getting all my programs to work. The latest hiccup is with Mail. Mail (the new version that was installed with Leopard), had been worki

  • Nexus 1000V. problem when working with the console VMWare

    I have a problem when working with the console VMWare. Sometimes it is impossible to connect any of the hypervisor to the guest OS managed by them. I get the message: "Unable connect to the MKS: Host address lookup for server <name of the hypervisor>

  • Error in Dynpro

    Hi all, I am getting error in Dynpro...if you go transaction code st22 and in that screen i got errors like dynpro_send_in_background if you double click on that and i can see this error... Error in ABAP application program The current ABAP program "