Open and close the Popup with Javascript

Using Apex 3.2

I probably have done this lots of times in my old job, but do not have access to the code and now I can't work properly.

I opened a window pop up with javascript
Now, I need to close and refresh the calling page, but only if it ratifies the validation on the popup.
I have an item hidden on my pop up called P7_FLAG.
I have a process page after validation that affects P7_FLAG (only the value 1, if passes validation).
I also have a "SUBMIT" button.

So once I click my button "SUBMIT" page should look at validations, so ok, P7_FLAG the value 1, then close the popup and refresh the calling page.

My current look of javascript 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>
My button
javascript:saveChanges();
The problem is that I need to click twice on the button SUBMIT.
First, it sets P7_FLAG
Second time, it closes page and refreshes.

I probably made a fundamental mistake, but today I can't.

See you soon

Gus

Published by: Gus C 10 may 2012 12:48

Sorry about that I was blind

Add this function to your page


Call this function on the loading of the page

onload="onloadclose();"

Tags: Database

Similar Questions

  • Open and close the Panel the Subvi front

    Hi all

    Run LabVIEW 2011 on Windows 7 x 64.  I am trying to get a Subvi front to open from my main PC with the touch of a button, then close with a button press in the Subvi.  Here's the piece of my main FP who calls the VI and opens the FP

    Locations is defined in another loop and all loops are in a flat order.  I made this way because I want to start with the first press and not stop my main loop to run.  So I don't know if I can run in the same line as the event or not, I've moved the element to the left loop around a lot.  Anyway the VI of openness seems to work very well.

    The problem arises when you try to close the Subvi for the SECOND time.  The code is here:

    As I said, the first time I open and close the VI everything works as it should, hopefully.  Then, I am able to reopen but now 'empty' button does not work and I can't close the window or even to open the block diagram to probe anything.  I tried to understand this point for a while, any insite would be greatly appreciated!

    Thank you

    Found my problem, I had the wrong boolean on one of my other events.  If this seems to be a good way to open/close a Subvi if anyone is interested!

  • Open and close the connection in oracle procedure

    Here is the procedure I'm in I insert data into the table temp_soap_monitoring using the select statement. I have soap_monitoring table FONIC_RETAIL database where I want to take the data and insert into the table temp_soap_monitoring. I play the position of planner of all 5 minutes for this procedure so that I get always the latest data in soap_monitoring@fonic_retail table. The problem of this procedure is that it takes too much cost and the query execution time to perform this procedure. Whenever he tries to extract the data from db link and save my local database. I remember in Java, php, and other programming languages, we have method in order to open the db connection when we tried to extract data from db link and then once integration is complete, we can close the db connection. So the performance improves and also has no load on db link. In this method, we have to assign link db to retrieve the data. So I think is it possible to apply this logic in my oracle procedure. The question arises because at this moment I am hard code the link db, but now I have 3 db more links and I will not reproduce the same procedure by assigning diffferent db links.

    PROCEDURE  "EXT_SOAP_MONITORING" AS

    LAST_SM_ID Number
    := 0;
    LAST_CAPT_DATE DATE
    ;

    BEGIN

    SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING';

    insert into TEMP_SOAP_MONITORING(ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE)
    select ID,REQUEST_XML,RESPONSE_XML,WEB_SERVICE_NAME,WEB_METHOD_NAME,CREATE_DATE,ERROR_CODE,ERROR_MESSAGE from
    SOAP_MONITORING
    @FONIC_RETAIL WHERE WEB_SERVICE_NAME ='RatorWebShopService'  and WEB_METHOD_NAME = 'placeShopOrder' and ID > LAST_SM_ID order by ID desc;

    update
    CAPTURING
    set LAST_TASK_ID=
    CASE WHEN ((SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL) AND (LAST_TASK_ID  IS NULL)  THEN (SELECT MAX(ID) from SOAP_MONITORING@FONIC_RETAIL)
    WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1
    ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
    CAPTURING_DATE
    = CURRENT_TIMESTAMP, LAST_CAPTURED_DATE = LAST_CAPT_DATE where DB_TABLE='TEMP_SOAP_MONITORING';

    END EXT_SOAP_MONITORING;

    I have it here is the procedure which I insert data in

    temp_soap_monitoring table by using the select statement. I have

    soap_monitoring table of FONIC_RETAIL database where I want to take the data and insert into the table temp_soap_monitoring.

    WHY? Why you are moving the data? Why not just use it table, is it already?

    The problem of this procedure is that it takes too much cost and the query execution time to perform this procedure.

    The solution is to FIND THE PROBLEM. Troubleshoot the code and find out where is the problem, if any.

    Based SOLELY on what you have posted the solution might be to add just an appropriate index.

    Whenever he tries to extract the data from db link and save my local

    database. I remember in Java, php, and other programming languages, we

    method to open the db connection when we tried to extract data of

    DB link and then once integration is complete, we can close the db

    connection.  So the performance improves and also has no load on db link.

    What? The LAST thing you want to do is keep the closing and opening of the connections. I don't know how 'remember you' from Java or other languages. The main reasons pools of connections were invented to AVOID have to repeatedly open and close connections.

    A db link not a NOT a "charge" - the "charge" is the query is made. If you write a poor query or have a poor data without the necessary index model, or have missing statistics, then you will get poor results.

    In this method, we have to assign link db to retrieve the data. So I have
    is it possible to apply this logic in my oracle procedure to belive. The
    question arises because at the moment, I'm hardcode db link but now I
    have more ties db 3 and I will not reproduce the same procedure by
    assigning diffferent db links.

    You can certainly write Java code to connect to each database with a direct connection. But all write code PL/SQL must include the database link. And the only way to avoid hard-coding the link is to keep the names of link in a table and use dynamic sql statements to build and run the query. This isn't what you want to do if you're looking for performance.

    SELECT LAST_TASK_ID INTO LAST_SM_ID FROM CAPTURING where DB_TABLE='TEMP_SOAP_MONITORING';

    For all we know which could be the WHOLE CAUSE of your problem. If there is no index on the table, you could do a full table to a table with lines scan 800 billion;

    We have NO WAY of knowing since you haven't posted info. Please read the faq to find out how to post a request for tuning and the info you provide.

    1. the query

    2. the table and index DDL

    3. the execution plan

    4 RowCounts for tables and query predicates

    5. the info on the stats: how you collected them and if they are up to date

    update
    CAPTURING set LAST_TASK_ID=
    CASE WHEN ((SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL) AND (LAST_TASK_ID  IS NULL)  THEN (SELECT MAX(ID) from SOAP_MONITORING@FONIC_RETAIL)
    WHEN (SELECT MAX(ID) from TEMP_SOAP_MONITORING) IS NULL THEN LAST_TASK_ID + 1
    ELSE (SELECT MAX(ID) from TEMP_SOAP_MONITORING) END,
    CAPTURING_DATE = CURRENT_TIMESTAMP, LAST_CAPTURED_DATE = LAST_CAPT_DATE where DB_TABLE='TEMP_SOAP_MONITORING';

    My guess is that TERRIBLE method of trying to get a 'LAST ID' is what's causing ALL your problems of performance. This method will not scale, and it will NOT properly work in a multiuser environment.

    You need create a good BATCH_CONTROL table that all processes use during the creation and execution of lots.

    The MASTER of the process batch:

    1 Gets a new BATCH_ID using a sequence

    2 locks the current row in the table control and uses / change the value "last".

    3 creates a new line in the control table for the new batch process

    4. the line of control to date with the start time, end time, result State, County, etc. for the batch

    Your likely PROBLEM of has NOTHING to do with the links of the db.

  • I'm looking for video clips that I can use to open and close my video with a third lower, y at - it a link to download these templates?

    I was looking for video clips on the theme, like a clip that opens and closes my video and with the lower thirds

    the lower third models are here, if that's what you're looking for?  Library, title, missing model projects templates: Premiere Pro, After Effects, yet

  • CreateInsert and see the popup with one button?

    Hello

    jdev 11.1.1.0.1 is used on an xp sp3 computer.

    in a jspx, I have a table surround with a collection of panels
    on this Panel, an imagelink binding action 'CreateInsert.execute '.
    Then I have to click another button to open a popup form to edit the new line.

    user wants to create and show the population with a single button

    1 click imagelink must do:
    -createinsert
    -display the pop-up form

    I try clientlistener and showpopupbehavior, but only the first action (craeteinsert) is performed.
    I think that the updating of the page, then the showpopup action is forgotten...

    Thanks for help

    Published by: bradici on October 21, 2009 14:47

    Open the context menu programmatically. delete showpopupbehaviour.

            FacesContext context = FacesContext.getCurrentInstance();
            String popupId = clientId;
            StringBuilder script = new StringBuilder();
            script.append("var popup = AdfPage.PAGE.findComponent('").append(p1).append("'); ").
                append("if (!popup.isPopupVisible()) { ").
                append("var hints = {}; ").
                append("hints[AdfRichPopup.HINT_ALIGN_ID] = '").append(ot2).append("'; ").
                append("hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_END; ").
                append("popup.show(hints);}");
            ExtendedRenderKitService erks =
                Service.getService(context.getRenderKit(),
                                   ExtendedRenderKitService.class);
            erks.addScript(context, script.toString());
    
  • No video and microphone when I open and close the laptop

    I have a Pavilion dv7 everytime I open and close my laptop to the camera and the microphone stops and it does not appear in Device Manager. It of like something is loose inside, this happened before its just out of warranty and how can it be solved?

    Thanks, I still have a warranty on the outside and I talked to them, so I'll send for repair. In the case of an ongoing problem I wish HP would recall and fix the problem.

  • Is there a tip action that will open and close the table of contents?

    I like that in CP5, Adobe has allowed users to change the icon associated with opening and closing of a Table of contents in layers.  Having said that, unfortunately, they show if small, I don't see what I created.  So, I was wondering, is there an advanced action or an action script that I could assign to a button that will allow my users open/close the table of contents?

    Thoughts?

    Eric

    I created a quick and dirty AS3 widget that can be used in Captivate 4 and Captivate 5 projects to open / close a table of contents in overlay with your own button mode.

    http://www.cpguru.com/2010/10/14/free-TOC-button-widget-for-Adobe-Captivate-4-AS3-and-Adob e-Captivate-5.

    Have fun; (o)

    / Michael

  • AR 11 opens and closes the unexpectadly.

    I just downloaded AR 11 and every time I try to open a file PDF AR closes after a few seconds. I can't view any PDF file. My operating system is windows 7.

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

  • Adobe DPS - programming link to a layer and close the popup button

    Hello world

    Two quick questions and hope that you can advise

    (1) how to link a button on a layer to a contextual layer in article - IE: report on the base layer and the material to a pop-up when you click another layer to display.

    (2) exactly how should I ask a button to close a layer and return to the starting point (if it is not an object of State Multi?-say a Photo you want to see in a larger size to appreciate it...) Is it just planning to hide this layer or another way?).

    Thank you: Daz

    You must be a subject of multiple State, MSO, which contains the information of your popup. This will trigger from an action of tap from a button or a hyper link. In my MSO pop-ups, I created the first State with an empty object. The State that contains the pop-up will have a button/hyperlink using one pass to the action of the State pointed to State 1, the object is empty.

    Learn more about WHO to:

    Digital Publishing Suite help | Overview of the interactive overlays

    Digital Publishing Suite help | Best practices for creating overlays

    DPS App advice

    Google

    Google

    If you want to take the user to the page that referred to another page/article add a goto://FolioNavigation/lastview at the end of your close button action. Test this on your iPad, because it does not work in the overview of the Office of the ID.

  • Opening files to automatically open and run the program with the input file

    My program has the ability to save and open a text file with a custom extension.  How to make the system in which the program is installed to recognize this file to open the program, AND how I understand the entrance to deposit in my program and load it.

    Thank you

    And now I understand how to debug by going to Run and by changing the arguments of the "command line" it.

    So resolved.

  • A menu button using custom on the slide to open and close the table of contents of Captivate 7

    Hello

    I have a custom menu button. When the user clicks on I want to see the table of contents, (I see there is a State to display the table of contents), but when the user clicks on the same menu again button on this slide how to hide the table of contents. IE, go hide and show.

    Thank you

    Captivate 7.0.1 contains a rocking action that allows you to enable a Boolean variable (for example the system variable that displays or hides the table of contents), and shutdown.  Use this action.

  • When I have two open browser windows, the first with several tabs, the second a window from a link (if one tab), and close the second window, I Quit Firefox message, ' do you want to save the tabs...?

    This was happening with FF 3 before moving on to 4 and not going on with FF4.0 until the 4.0.1 update has been applied, the first time, he ran. Same problem on another computer running FF3, so maybe a related problem of the extension.

    If I have three windows open and close the third, I don't get it. Only when two are open and one is closed. I could have three, close one, then the second and get the prompt.

    Non-disabled extensions
    Adblock more
    BugMeNot
    Cooliris
    Download Statusbar
    DownloadHelper
    DowntThemAll!
    FireGestures
    HTML5 Extension for Windows Media Player
    HTTPS everywhere
    Java Console
    Download the PDF
    Session manager
    TinEye Reverse Image Search
    YouTube how Snob

    People with disabilities

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • VI of hand stops fucntioning after as I open and close a Subvi to a structrue event.

    Hello

    I try to open a pop up vi of an event. I've been struggling with this for a while now. When I open a pop up vi and close it, the main vi stops correctly.

    I narrowed down it to the fact that the event that reminds the Subvi is never ending when the Subvi is closed.

    The attached picture is an example of what I'm doing. When I run the present, I never see the dialog box indicating "here.

    may be useful as an allusion to the problem...

    This does not work correctly if I run the vi, click to open the Subvi, close the Subvi (here the main vi is not working properly, do not click on anything whatsoever) then stop the main vi, run the main vi has even once, open and close the Subvi and then I see the dialog 'here '. , and my main vi works correctly.

    Thank you

    J

    What actually happens, is press you the Ok button and your panel closes and you set the stop 2 true.  OK, it's fine except that the stop Terminal 2 has already been read during this iteration of the loop.  So the loop will go again.  This time, it is read stop 2 to a REAL, but the structure of event needs an event before the loop can fill.  But the façade was already closed and you're stuck.

    As Dennis said, get rid of the 2 stop and just wire the TRUE constant straight out of the case of the event.  Wire a FALSE for all other cases of event.

  • Problem with 'Text input' and «Close a PopUp» required

    Hello world

    I'm having a little problem with a popup,

    I have a popup with I opened on the action of a button with this code...

    {} public void showPopup (RichPopup loPopup)
    FacesContext facesContext = FacesContext.getCurrentInstance ();
    ExtendedRenderKitService = service
    Service.getRenderKitService (facesContext,
    ExtendedRenderKitService.class);
    service.addScript (facesContext, ' AdfPage.PAGE.findComponent ('"+ loPopup.getClientId (facesContext) +"') ". show();" ');
    }

    Show pop-up, ok within the pop-up window, I have a window Panel and a presentation of form with 3 text input, this input due reg exp validation text and are true... in my layout, I have 2 buttons, one to save the changes, and another button 'Cancel' to close the popup...

    The problem I have is, if one of the text entry has an "Error Message" (for the validation of reg exp or need) and I click on the button 'Cancel', don't close my popup.

    My code to close the popup in my grain of support is:

    this.getPoPo1 (.cancel ());

    Where poPo1 is a var RichPopup

    I already try with masquer()... and nothing!

    Hope someone can help me, I want to emulate the close context menu icon feature.

    Greetings from the Mexico!

    Alberto Tapia

    A Cancel button to true immediate property?

     
    

    This setting configures if data - client-side or server-side validation - is ignored when the events are generated by this component.

    Timo

  • S EPQuicker displays and closes the program when I run epson easy photo print with sx230

    S EPQuicker displays and closes the program when I want to open an easy photo with print my sx 230

    Hello

    You asked your question in the text of the Microsoft Community. Please could you click on the globe icon to the world (change region) at the bottom left of the screen and then choose your preferred language. Now ask you question once again.

    Thank you.

Maybe you are looking for

  • where I have to see everything on my computer

    I'm trying to see everything on my computer and don't know where to go to find it.  I've been to the finder, but I wanted to make sure that the apps I downloaded have not downloaded twice.

  • HP Pavillion MS235: HP Pavillion MS235 All in One - how to make it faster?

    I would like to make the PC faster.  We had for some time, there isn't much about it then, but I would like to give to my son for his school work and games.  It's just slow.  Everything you do, takes so long.  No viruses have WebRoot on it.  Any idea

  • Rotation of bitmap with drawTexturedPath

    I'm trying to find the fastest way to draw a bitmap to an arbitrary angle.  Here's what I have so far: private void drawRotatedBitmap(Graphics graphics, Bitmap bm, int angle, int x, int y) { int w = bm.getWidth(); int h = bm.getHeight(); double a = M

  • fill aspect ImageView

    ImageView {}ID: bannerImageobjectName: "bannerImage."horizontalAlignment: PverticalAlignment: VerticalAlignment.BottomscalingMethod: ScalingMethod.AspectFit} Have this imageview, problem is that I bring the imageview from a url... If aspectfit aspect

  • BlackBerry BB Z30 Z30 locks completely in case

    Then... bought this Holster (see photo)... after that the phone is inserted into the skin (not in the Holster itself) the power/lock button no longer works. I mean it does not mechanically... it is like blocked. Works only the 1st time I touch insert