Close popup on completion of procedure

I have built a custom popup that I use to record a value in conjunction with the current screen. The popup gathers values from the current screen, asks the user for a little more input, then saves the records. The procedure is working great. After the procedure completes, I would like to close the popup window.
I've tried two things: using a Close Popup Window procedure and using hints from this thread:
Re: Close popup after MRU
I had it working (the close part) but I had to go back and alter some of my page and now it isn't working again. Can someone suggest what to look at?
HTML header:
<script language="JavaScript" type="text/javascript">
function closeWindow()
if ( document.getElementById("P1069_SAVESTATUS").value == 'R' )
  window.opener.location.href=window.opener.location.href;
  window.close();
</script>One HTML region, source is:
<script language="JavaScript" type="text/javascript">
  onLoad="closeWindow();"
</script>Region item P1069_SAVESTATUS     is set as Hidden, set to 'N' when session state is null.
Process is as follows (triggered by FINISH button):
declare
  v_job        NUMBER     := :P1069_TC_ID;
  v_dt         DATE       := to_date(:P1069_DT,'MM/DD/YYYY');
  v_emp        NUMBER     := :P1069_EMP_ID;
  v_pkg        NUMBER     := :P1069_PKG_ID;
  cursor c_pkg is select COURSE_ID from TRAINING_PKG_ASSIGN
            where COURSE_PKG_ID = v_pkg and COURSE_ID > 0
            order by COURSE_ORDER;
  v_crs        NUMBER;
  v_eemp       NUMBER     := :G_USER_ID;
  v_edt        DATE       := SYSDATE;
begin
  delete from EMP_TRN_HISTORY
   where TC_ID = v_job;
  open c_pkg;
    LOOP
      FETCH c_pkg into v_crs;
      EXIT WHEN c_pkg%NOTFOUND;
        insert into EMP_TRN_HISTORY (EVENT_ID, EVENT_DATE, TRN_CRS_ID,
              ENTRY_EMP_ID, ENTRY_DATE, TC_ID, EMP_ID, PKG_ID)     
           values (SEQ_EMP_HISTORY.nextval, v_dt, v_crs,
                 v_eemp, v_edt, v_job, v_emp, v_pkg);
    END LOOP;
  close c_pkg;
  :P1069_SAVESTATUS  := 'R';
end;

Try changing the HTML in your region to
<script language="JavaScript" type="text/javascript">
  closeWindow();
</script>the onload="" notation would be used if you were putting the function call in the <BODY> tag of the page.

Similar Messages

  • How to close popup with af:commandButton without submitting values?

    Hi all,
    I'm using JDeveloper 11.1.2.1
    My popup has few af:inputText components with value attribute binded to view scope variables.
    I set those view scope variables in backing bean before showing popup.
    When I change values of input fields and click cancel (af:commandButton, partialSubmit=true, immediate=true), popup is closed.
    Then, when I show popup again, values that I changed are visible although I set new values to view scope variables in backing bean before showing popup again.
    I noticed that when I close popup using close icon in upper right corner of popup everything works fine.
    Also, I tried using dialog cancel button and it also works fine.
    Is there a way for closing popup using af:commandButton but without submitting values?
    In previous releases of JDeveloper (<= 11.1.1.5) I didn't noticed this problem.
    Thanks in advance,
    Aleksandar

    Alexandar wrote:
    Is there a way for closing popup using af:commandButton but without submitting values?If you really want to use your own button without submitting, then some three lines of Javascript will do the trick. See the documentation of af:popup for that. Canceling a popup is a pure client-side operation. No event is sent to the server. No submit. No need to reset anything. That's basically what the built-in cancel button does as well.
    Sascha

  • How to disable "Close on successful completion"?

    Hey guys,
    I just had a quick question about the deployment dialogue in LabVIEW
    There is a check box called "Close on successful completion" when you deploy your LabVIEW code with shared variables or deploy the code to RealTime OS.
    Is there a settings saved somewhere that I can uncheck this? I checked the xml file of labview project itself but cant seem to find it.

    I am not sure about other ways but one workaround is, diconnect the RT communication and deploy so it will fail. Now you can uncheck the option and then the selection will be retained.
    The best solution is the one you find it by yourself

  • Don't close popup window on action

    Hello!
    I have a popup window, which contains another window from my component. I assigned actions to buttons. I need not to close popup after action in some cases. I want to decide in action's method. How can I avoid closing the popup?
    Edited by: Konstantin Milutin on Feb 24, 2010 12:55 PM

    Hi,
    when u are creating the pop up window then there is a parameter close_in_any_case set its value as abap_false.

  • Force to close popup

    Hello,
    Im using Jdeveloper 11g .
    I have popup.On the popup you can choose what kind of file do you want to open and to press OK button for opening file. And everything works fine. But I want to close popup when you choose file nad after pressing button OK.
    On other popup this is work corectly but here not, because button is calling fileDownload.
    This is way how i usualy clos popup:
    FacesContext context = FacesContext.getCurrentInstance();
    String popupID= popID.getClientId(context);
    StringBuilder script = new StringBuilder();
    script.append("var popup3 = AdfPage.PAGE.findComponent('").append(popupID).append("'); ").append("if (popup3.isPopupVisible()) { popup3.hide();}");
    ExtendedRenderKitService erks = Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
    erks.addScript(context, script.toString());
    This is button:
    <af:commandButton text="OK" id="cb1"
    actionListener="#{backingBeanScope.Izvodi.closePopup}">
    <af:setActionListener from="#{pageFlowScope.idIzvoda}" to="#{pageFlowScope.Print.jasperParam}"/>
    <af:setActionListener from="eizvod" to="#{pageFlowScope.Print.jasperTip}"/>
    <af:setActionListener from="#{backingBeanScope.Izvodi.vrstaStampeSufiks}" to="#{pageFlowScope.Print.jasperVrsta}"/>
    <af:fileDownloadActionListener contentType="application/x-download" method="#{pageFlowScope.Print.printReport}" filename="#{backingBeanScope.Izvodi.pdfXls}"/>
    <af:resetActionListener/>
    </af:commandButton>
    Do you have idea how to force to close popup after pressing button OK????
    Thanks!!!!

    I really dont know how it doesnt work for me.
    Please, take a look.
    <af:popup id="popStampaj" eventContext="launcher" launcherVar="source" contentDelivery="lazyUncached" binding="#{backingBeanScope.Izvodi.popStampaj}">
    Bean:
    import oracle.adf.view.rich.component.rich.RichPopup;
    private RichPopup popStampaj;
    public void closePopup(ActionEvent actionEvent) {
    popStampaj.hide(); // method hide not found
    public void setPopStampaj(RichPopup popStampaj) {
    this.popStampaj = popStampaj;
    public RichPopup getPopStampaj() {
    return popStampaj;
    It is all. I really dont know what is problem. How do you have method hide() and I dont have???
    Do you use the same version JDeveloper like me?
    Thanks :)
    Edited by: djavolchic on 09.06.2010. 03.53

  • Can use facetime on my I phone 4S but can not complete registration procedure to activate on my Macbook Pro

    can use facetime on my I phone 4S but can not complete registration procedure to activate on my Macbook Pro

    Hey Yusuf Hassan,
    Thanks for using Apple Support Communities.
    This article should be able to get you to activate on the Mac.
    FaceTime for Mac: Troubleshooting FaceTime
    http://support.apple.com/kb/ts4185
    Activating FaceTime for Mac
    Use your Apple ID to register and use FaceTime. FaceTime registration validates your Apple ID and email address for use with FaceTime.
    If you are unable to activate FaceTime, try the following:
    Sign in to FaceTime for Mac using a valid Apple ID. After you validate the email address for use with FaceTime, other FaceTime users can connect to you using that email address. If you encounter issues registering or using an Apple ID account:
    Ensure that you have an active Internet connection.
    Verify that you are using a valid Apple ID at appleid.apple.com. You can also create an Apple ID or reset your password from this website.
    Check that your email address is verified in FaceTime > Preferences.If FaceTime > Preferences shows your email status as "verifying," follow the instructions in the verification email that was sent to complete the process.
    Toggle FaceTime off and on in FaceTime > Preferences.
    If still unable to Sign In follow the instructions in FaceTime, Game Center, Messages on OS X: Troubleshooting Sign in
    Have a nice day,
    Mario

  • How to close PopUp (from taskflow region)???

    Can someone, please, explain how to solve this use-case:
    I have PopUp in which I put a region (in which is a small TaskFlow consiting of 2 JSFFs). I want to have Cancel and OK buttons in both JSFFs in TaskFlow. How to close PopUp from within TaskFlow ??? I saw the TaskFlow Return component in ADF TaskFlow diagram components (in palette) but haven't found any help/documentation on it. Or, should I use Return listener on command button used to rise popup (but, still, how to close popup from taskflow?)?
    Any help would be great!
    Thanks in advance,
    Marko

    mimarko,
    Regions/Taskflows are meant to be isolated reusable components. They are not meant to
    have knowledge of their parent or container. That said, code contained with in a region should not attempt to reach out an modify the parent. Regions can fire contextual events that can be handled by a listener declared in the parent pages pageDef. However, attempting to close a popup from a context listener would be bad practice. The easiest fixt is to put the popup in the taskflow for your region. That will create a reusable popup that you can use through out your application.
    --Ric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Close Popup on clicking OK button of Information Message Dialog

    JDev 11.1.1.5.0 ADF BC
    I have a popup and a dialog inside it where user inputs some data and clicks Save button.
    I am showing an Information message on click of Save on successful insertion of data into the database.
    What I am looking to achieve is that I want to close the popup window on click of the OK button which is inside the information message dialog that is been shown on successful Saving of data.
    There is already a similar thread Close popup in adf but that doesn't have a correct answer.

    1) Bind the main popup to a bean variable:
    <af:popup id="mainPopup" binding="#{MyBean.myPopup}" ...>
    public class MyBean
      private RichPopup myPopup;
    }2) Add a DialogListener to the <af:dialog> of the information message:
    <af:popup id="infoPopup">
      <af:dialog dialogListener="#{MyBean.infoPopupDialogListener}">
        ... Info message here ...
      </af:dialog>
    </af:popup>3) Use this DialogListener to close the main popup programatically:
      public void infoPopupDialogListener(DialogEvent dialogEvent) {
        myPopup.hide();
    }Dimitar

  • Need popup w/o buttons to display info then close popup...

    Hello Experts,
    I need a popup to show info like "Saving of PO form is in progress..." without any buttons.
    Just a window to show some text then when a certain condition is true, then I will close the popup.
    Below is a rough idea of what I want to achieve:
    - call popup to display message
    - LOOP statement
         if condition is true, then close popup
    The popup should not contain any buttons because we do not want to let
    the user close the transaction.
    Thank you guys and take care!

    Hi
    I infer from your discription is that you just want to display a pop-up containing a message to the end user.
    For this you can make use of MESSAGE of type I. It does display the mesage in a pop up window.
    You can also try out the Function Module: POPUP_FOR_INFORMATION.
    Hope this solves your problem.
    Regards
    Gaurav.

  • 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'');');

  • Error after close popup with swfloader

    Hi all, hope some one could help me with this i get this
    error ( Error: Unable to load '' ) each time after i close a popup
    with a swfloader the error popsup when i click on the datagrid
    *****************************main mxml
    private function ShowPano():void
    var SWFLoaderInstance:Panoramica2 =
    Panoramica2(PopUpManager.createPopUp(this,Panoramica2,true));//
    instantiate and show the title window
    PopUpManager.centerPopUp(SWFLoaderInstance);
    SWFLoaderInstance.mainAppPano = this //Reference to the main
    app
    scope
    *******************************this is the mxml Panoramica2
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="doInt()"
    cornerRadius="10" width="600" height="450">
    <mx:Script><![CDATA[
    import mx.controls.PopUpMenuButton;
    import mx.managers.PopUpManager;
    import mx.collections.ArrayCollection;
    import mx.controls.Button;
    [Bindable]public var mainAppPano:Object = null;
    //called by the close event raised byclicking the close
    button
    private function closeWindow():void
    PopUpManager.removePopUp(this);
    }//closeWindow
    private function doInt():void
    PopUpManager.centerPopUp(this);
    ]]>
    </mx:Script>
    <mx:TitleWindow layout="absolute" right="10" left="10"
    showCloseButton="true"
    close="closeWindow()" top="10" bottom="10">
    <mx:SWFLoader
    source="{mainAppPano.datagrid.selectedItem.pano..src}"
    scaleContent="false"
    horizontalCenter="0" verticalCenter="0"/>
    </mx:TitleWindow>
    </mx:Canvas>
    ********************************xml structure
    <catalog>
    <libro>
    <name><![CDATA[<b>Biblioteca Central
    </b> ]]></name>
    <desc><![CDATA[Se inauguró el 20 de noviembre
    de 1978 ]]></desc>
    <imagen>FOTOS/est/Biblioteca Central Manuel Bartlett
    Bautista.jpeg</
    imagen>
    <pano nombrePano="Biblioteca Central Bautista">
    <src>FOTOS/Panoramicas/PanoZoom642007.swf</src>
    </pano>
    <ico>BOTONES/gifs/video.gif</ico>
    <video nombreVid="Biblioteca Manuel Bartlet">
    <src>VIDEOS/Biblioteca Manuel Bartlet.flv</src>
    </video>
    <audio/>
    <pie>Biblioteca Central Manuel Bartlett
    Bautista</pie>
    </libro>
    </catalog>

    <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'');');

  • To close popup page from parent page .

    HI ,
    I want to close the popup page when my parent page is redirected to login page when session gets invalidated.
    with out calling any onload or any kind of functions in popup jsp page.
    In my application when i open a popup page from the main page ,when the session is getting expired parent page is redirected to login ,but still the popup page is in active state.i want it to be closed when the redirect happen for the parent page.
    Please help me in this matter.
    Thanks in advance.

    This is a Javascript question, not a JSP question.
    I'll give only a hint then: get hold of the handle of the popup window so that you can call close() on it.
    If you stucks, please continue at a JS forum. There are ones at webdeveloper.com and dynamicdrive.com. Once again: JSP is completely irrelevant in this question. Just base the problem on the HTML and JS output generated by JSP.

  • Flex mobile - close popUp with back hardware key - bug?

    Hi everyone,
    i am having a problem with a popUp in my firstView aka HomeView. I used a similar logic as provided by the DashBoardMobile reference example: (http://www.adobe.com/products/flex/examples/)
    when i open the PopUP i add a EventListener with the HandlerFunction to close the popUp if the device back-key is pressed:
    systemManager.stage.addEventListener(KeyboardEvent.KEY_UP, deviceKeyUpHandler, false, 1000, true);
    protected function deviceKeyUpHandler(event:KeyboardEvent):void
                    var key:uint = event.keyCode;
                    if (key == Keyboard.BACK)
                        event.stopImmediatePropagation();
                        event.stopPropagation();
                        closePopUp();
    So far this had worked fine (if a popUp is open its get closed, if no popUp is open the previous View is poped)
    Now i made a popUp for the firstView of my app, and there this doesnt works, if i press the back-kay the application is closed wether the popUp is open or not...

    You might want to try listening for the backKeyPressed event on the View instead: http://polygeek.com/4225_air-mobile_go-your-own-way-overriding-the-back-key-press-in-air-m obile-apps
    In that handler if your popup is open you'll want to preventDefault() on the event and call your close logic.

  • Save and close popup window

    I have a typical popup window launched using the builtin javascript:popupURL().
    I would like a Save and Close button on this popup window that does
    1. Submits the popup page so that changes are saved into session state
    2. Close the popup window
    3. Refresh the parent window so that updates in (1) are reflected
    What is the recommended way of doing this? I was thinking of the following URL redirect on the Save & Close button
    doSubmit('SAVE');
    window.opener.location.reload();
    window.close();Do I need a same-page branch on the popup page? If so, why? If not, why? ;-)
    Comments?
    Thanks

    This is a bit of javascript that I nicked which works well for me:
    -- 1. Add the folowing to your page header or create a new page template --
    -- (popup window template) and put it in the header section. --
    SCRIPT LANGUAGE="JavaScript">
    function loadinparent(url, closeSelf){
         self.opener.location = url;
         if(closeSelf) self.close();
    </SCRIPT>
    -- 2. Use the following to call the function. the true and false keeps the parent--
    -- window open or closed. Obviously set any values in the URL. --
    javascript:loadinparent(''<URL>'', true)
    eg. javascript:loadinparent(''f?p=&APP_ID.:40:&SESSION.::NO::P40_ID:'||ID||''', true)
    -- Inc the following comment in your header --
    -- Version 1.0
    -- Last Updated: May 18, 2000
    -- Code maintained at:
    -- http://www.moock.org/webdesign/javascript/
    -- Copy permission granted any use provided this notice is unaltered.
    -- Written by Colin Moock.
    Simon

  • Close popup with branch

    I have created a page with a "New party" button that opens a popup. It clears that cache for the popup and works fine.
    The new party can be entered and "create"d. The page branches to itself and the create button is not displayed. The new party data is saved in the table.
    The popup page has a computatoin to put the party_id into the calling page item. The Cancel button is a URL target: javascript:window.close();. This closes the window.
    Two questions;
    I want the branch to be a URL target that closes the page but I can't get it to work. The URL calls this in the Page HTML Header:
    <script language="JavaScript1.1" type="text/javascript">
    function passBack(){
    window.close();
    window.opener.location.reload(true);
    I made the only branch a URL and entered this as the url: -- javascript:passback() -- It never executed the function.
    I then tried -- javascript: window.close(); -- and the window did not close. This is the same code the Cancel button uses.
    What am I missing?
    Second question; I clicked the Cancel butoong, the window closed and on the calling page I looked at the session variables and the party_id was flagged as R but I did not see the value? Did it not write the session variable? Is there any way for me to check?
    Tia,
    Sam

    Sam,
    Why are you trying to take the user away from the current page? This can over complicate things. Have you considered a wizard approach where they could select "Create New" which would allow them to create the new entity?
    What I've found to work best is to provide a link to another action and bring the user back. For example, lets say I have a two step process: Create User and Assign User to Projects. In the wizard to Assign User to Projects I'll provide a link that says Create User. The link takes the user to the Create User wizard while setting the value of an item that the Create User wizard will later reference to bring the user back to the same spot in the Assign Users wizard.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

Maybe you are looking for