Dynamic Action on "Get Focus" After Closing a Popup Window

Hi,
From one of APEX Application Pages I am calling a Popup Window where users can create a new record. In the Popup Window once the record is created and window is closed, I want to refresh the region on the main page to show the record created in the popup window.
How do I create a dynamic action which will fire when the main APEX window gets the focus (after the popup window is closed). ?
Any pointers will be greatly appreciated.
Thanks & Regards,
Ashish Agarwal
http://www.asagarwal.com

Assuming that you have a dynamic action in the parent page which refreshes the region
<li> Make a note of the event which triggers your dynamic action, lets call this event A.
<li> Create a JS function in parent page which triggers event A when called.
For example if your Dynamic Action trigger is a button(id ="P100_REFRESH") press event
Your JS function could be
function Trigger_refreshRegion()
  $('#P100_REFRESH').click();
The way in which you simulate the Dynamic action deoends on the firing event that you have used, so modify it appropriately.
<li>Now in the pop up page, if you are closing the page in JS using smthing like window.close() or so,
just call the parent page's refresh JS function there using the
  opener.Trigger_refreshRegion(); //whatever was the name of the function that you created.

Similar Messages

  • New feature in SP5: Closing a popup window raises an event

    I'm trying to use this new feature that came in SP5, "Popup Enhancement - Closing a popup window raises an event to the containing iView".  Can anyone give me an example of how this works?  In the configure element for the popup, there is a new field called, 'Closure Event'.  I though by adding by event to this new field, that the event will be raised after closing the popup window, but it didn't.  What am I doing wrong?

    Hi,
    you should add an end-point to the popup and/or use the "Close" action.
    there's a difference between when closing the popup implicitly or explicitly

  • Message (of message manager) gets lost by opening a popup window

    Hi all,
    On behalf of a better error/exception handling, I would like to show the stacktrace in a popup window, that means, if the application reports an error message (through the message manager in the view controller), the user (administrator, developer) can optionally click a link (LinkToAction => opening a modal window) to see the stacktrace in a separat popup window.
    Unfortunately if the popup window now gets displayed, the error message on the main view (background of the popup window) will be cleared, so this - for the common user more readable - information is not anymore displayed, also when the popup will be cleared.
    Of course, I could backup the error message in a context value and redisplay it after closing the popup window, but I suppose that's not a very cool solution...
    Other any good ideas?
    Thanks,
    Stefan

    Hi Stefan
    Usually showing a stack-trace to the end-user of your application is not so helpful as might appear. My experience shows that the information is too technical for the end-user and does not help him/her to resolve the issue/problem. It's better to display error messages pointing him to some solution or directions that he might do in order to fix the error.
    If you still want to show a stack-trace I'd advise the following. You have to prepare the UI control with the stack-trace in the same server response (round trip) which shows the message manager's messages. The messages will not disappear until a client sends a new request to the server. When you open the popup such request definitely takes place.
    Maybe try to display the stack-trace in the bottom of the screen so user have to scroll down a little bit to show the trace.
    Or maybe Tray control will help in the case. Try to put the trace in a text view and put the view in a tray. Then user has to expand the tray to see the trace. But do not assign any event handlers to the tray to avoid additional request to the server while it's expanding.
    BR, Sergei

  • How to Direct control to application's window after closing the popup?

    Hi,
    I am using 10.1.3. In my application I am unable to direct control to application's window after closing the popup, if I open any other window at the same time.
    For more info see the below step:-
    -> Open any popup in my application.
    -> Open any new window (lets say Google.com).
    -> Now restore popup on Google window.
    -> Now close popup
              - control goes to Google window but not the parent application window.
    How to direct control to the parent window?
    Can anybody help me regarding this?
    Thanx...Abhijit

    Hi Abhijit,
    You can do this using Javascript alone. Below are the two sample files I created.
    main.html_
    <html>
    <head>
      <title>Testing popup</title>
      <script type="text/javascript">
      function openPopup() {
        window.open("popup.html");
      </script>
    </head>
    <body>
      <a hr_ef="javascript:openPopup()">Open popup</a>
      <input id="something" name="something" type="text" value="something">
    </body>
    </html>
    Note: hr_ef should be href. The code tags are messing with the link.
    popup.html_
    <html>
    <head>
      <title>This is the popup window</title>
      <script type="text/javascript">
      function goToMain() {
        window.opener.something.focus();
      </script>
    </head>
    <body onunload="goToMain()">
      This is the popup window. Close this window to return to main window.
    </body>
    </html>The idea is to call a javascript function in the popup window that tries to focus on an object (eg. InputText) in the main html.
    Although, one point to take note is the naming of html objects by by these ADF UI Components. If you named your form id as "*form1*" and input text id as "*something*", your input text id will end up as "*form1:something*".
    Therefore, you will have to tweak the code above to the following:
    <script type="text/javascript">
    function goToMain() {
      window.opener.form1['form1:something'].focus();
    </script>Regards,
    Chan Kelwin

  • Refresh the table after closing the Popup iView

    Hi all,
    I have list of survey in my table. In that table i have toolbar button(DELETE) for deleting the survey. While deleting the survey it asks the confirmation. If we click Ok it delete the selected survey and close the popup also. what I want is I should refresh the table after closing the Popup.How can i achieve this?
    Help me in this regard.
    Thanks & Regards,
    Hemalatha J

    Hi Hema,
    Check this link.
    Visual Composer - You can do anything....
    In this blog, they are used 'Refresh' Button and a Hidden 'Plain text' message to solve this problem. If you are satisfy with this you can take this solution.
    Or you can try to trigger the 'Submit' action of 'Input form' once again from the 'Popup window' when the 'Delete' button is clicked.
    Hope it helps...
    Regards
    Basheer
    Edited by: Basheer on Dec 23, 2008 8:03 PM

  • Avoid window getting focus after pressing a mouse button on it

    I want that a window does not get focus although I press a mouse button on it, in Windows XP.
    I have search in Microsoft help and this fact is controlled by the Operating System itself. The notification that is sent after the user presses a mouse button is WM_MOUSEACTIVATE notification. The return value of this notification indicates the behaviour of the window after the mouse down, existing 4 options: MA_ACTIVATE, MA_ACTIVATEANDEAT; MA_NOACTIVATE & MA_NOACTIVATEANDEAT. The default is the first one, but I want to change the behaviour of the window to be the the third one: MA_NOACTIVATE, that does not activate the window, and does not discard the mouse message. The function that performs this is DefWindowProc according to the MSDN Help content.
    Any help about doing this in Labview? Is there any special function in Labview that allows setting this behaviour to a window or should I use a Windows dll? In that case how can be programmed? Has anyone done it before? I'm working with Labview 8.6.1, and I haven't found anything about this. Any help will be very useful.
    Thank you very much in advance.
    David Fernández

    It is the front panel window of a VI which I don't want to get focus. I have tried to achive this with property nodes, but the problem I think that cannot be solved in this way, because is the Operative System that gives the focus to the window when pressing a mouse button before Labview does anything. You can release the focus once the window have taken it with the Front Panel window focus property node, but what I really want is to keep the focus on the old window.
    My idea is that the VI act as a background of my application, so never can be over the rest of the windows. Some of them are floating but others are standard and I don't want to use modal windows, so I cannot solve this with the Window Appearance options.
    I have also tried to discard the mouse down in the Mouse Down? event, but I doesn't work, the window continues getting the focus although does not carry on any action.
    Any suggestion?
    Thank you for your interest
    David F

  • Source Safe causing LabVIEW Quick Start Screen to not appear after closing open vi windows?

    Hey All,
    We've recently implemented Source Safe version control for LabVIEW on XP and I've noticed that LabVIEW is hanging between closing open vi windows and showing the Quick Start Screen.  The usual pattern is for the Quick Start window to appear after the last open vi window is closed.  Instead the vi window is closed, the tab at the bottom of the screen says debug development and the Quick Start Screen does not appear, the tab does not read "Getting Started."
    I think it is a LabVIEW <--> Source Safe issue when I do a Task Manager Exit on the LabVIEW process that I sometimes see a dialog box asking if I want to save changes in memory to disc and those files are not checked out.  But it is too late at that point to do anything as XP clobbers the application before I can do anything.
    Anyone else have this issue?
    Message Edited by Drewski on 05-30-2008 02:28 PM

    What LabVIEW version do you use?
    I have used SourceSafe in every version from 8.0, and in the way some bugs are resolved.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • IFrame(child container) still visible after closing the title window(parent container)

    Hi All ,
    I have created a sample project using a link button which when clicked opens up an TitleWindow which has an iframe and a text area in a hbox
    When you execute the application ,
              Click the link button
              The Popup window opens up showing the title window with the close button
              Click the close button of the title window
              The Title window is removed and the iframe and the text area are not visible
    Do this a couple of times
    You can notice that the iframe is still visible even when the title window is closed
    Can someone explain me how this issue can be resolved and also explain me why the iframe(child container) is still visible when the title window(parent container) is not visible. 
    Main Application file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
        width="100%" height="100%" creationPolicy="all"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical" creationComplete="init()"
        xmlns:containers="containers.*">
       <mx:Script>
       <![CDATA[
           import mx.managers.PopUpManager;
           import containers.PopUpBrowser;
           public function doRequest():void
                    var requestPopup:PopUpBrowser = PopUpManager.createPopUp(this, PopUpBrowser) as PopUpBrowser;
                    PopUpManager.addPopUp(requestPopup,this);
                    requestPopup.x = 220;
                    requestPopup.y = 50;
       ]]>
       </mx:Script>
       <mx:Text fontSize="14" fontWeight="bold" text="Click the link button below to open the Title Window" />
       <mx:Spacer height="100"/>
       <mx:LinkButton label="Click me" fontSize="16" fontWeight="bold" click="doRequest()"/>
    </mx:Application>
    PopUpBrowser.mxml Component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
        xmlns:mx="http://www.adobe.com/2006/mxml"
        close="removeMe()"
        showCloseButton="true"
        styleName="myTitleWindowStyle"
        width="850" height="500"
        title="Klout User Profile"
        paddingTop="1" paddingBottom="1"
        paddingLeft="1" paddingRight="1"
        xmlns:generic="com.serendio.voom.components.generic.*"
        xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
        horizontalScrollPolicy="off"
        verticalScrollPolicy="off" >
        <mx:Script>
            <![CDATA[
                import mx.managers.PopUpManager;
                public function removeMe():void
                    PopUpManager.removePopUp(this);
            ]]>
        </mx:Script>
        <mx:HBox width="100%" height="100%">
        <flexiframe:IFrame source="http://www.google.com" id="iFrame" width="50%" height="100%"/>
        <mx:TextArea text="Open and close the title window few times and watch the iframe remain visible even when the title window is closed"
             fontSize="14" width="50%" height="80%"/>
        </mx:HBox>
    </mx:TitleWindow>
    Thanks,
    Ajantha

    Hey,
    This is working fine for me with the current 4.5 Flex, Firefox 3.6.12, IE8. On what browser you are getting this error.
    Thanks,
    Jayagopal.

  • I use private browsing and passowords not remembered. yet after closing all firefox windows, i can access facebook and hotmail w/o my login info being requested

    it used to ask me for them when i re-opened a window after closing all the previous ones!

    Are you automatically reopening windows from the previous session via session restore?
    *Tools > Options > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"
    You can set the <b>browser.sessionstore.privacy_level</b> pref to 2 (never) or 1 (non-HTTPS) on the <b>about:config</b> page to disable saving cookies via session restore.
    The browser.sessionstore.privacy_level_deferred pref is used when you do not reopen the previous session automatically via "Show my windows and tabs from last time" and uses the same values
    * http://kb.mozillazine.org/browser.sessionstore.privacy_level
    *http://kb.mozillazine.org/about:config

  • How to disable a commandbutton  from bean after closing a popup.

    Hi,
    I have a scenario where there is a popup with a button.On click of the button the popup must close and all the buttons in the parent page must be disabled.
    I tried the following to disable the button in the parent page:
    commandbutton1.setDisbled(true);
    AdfFacesContext.getCurrentInstance().addPartialTarget(commandbutton1);
    But it doesn't work.Am I missing something here ?
    Thanks!
    Rohit

    seems like the page is getting refreshed after your code..
    Try keepng the button used to close the popup as partialSubmit="True"

  • Bug? InDesign CC/CC2014 loses focus when closing ScriptUI dialog window

    When closing a "dialog" type window, created using ScriptUI from Extendscript, InDesign will lose focus as "active application" in Windows (7/8) and instead switch to another application in Windows altogether. This behavior does not occur on previous versions of InDesign (CS6 and earlier). I can easily reproduce the problem at my company on various machines (both on Windows 7 and Windows 8). The Mac OS version of InDesign does not seem to have this problem. Also, the problem does not seem to occur when using "palette" or "window" type ScriptUI windows.

    That's in itself an interesting observation, but I have the focus problem 
    also with scripts that don't use ScriptUI at all.
    Peter
    On Mon, 13 Oct 2014 08:38:27 +0100, DirkEBM <[email protected]>

  • Need to dynamically include an image file when calling a popup window

    I am working on a web dynpro Java app which uses a button to call a popup window/view. Within the popup, I want to dynamically choose an image to show (from mime types) based on a criteria...there will be multiple buttons on the initial view that all call the same popup, but the popup will have content specific to which button called it (specifically the image embedded in the view).
    My question is, what is the proper/best way to do this?
    Here are some possible ways I can think of...
    1. Pass a parameter from each button during the call of the event, but how does that get sent to the implementation of the second view for use in determining which image? And, how do I modify the source property of the image element based on that parameter?
    2. Create multiple pages and views for each button to call...but this seems decidedly un-DRY.
    3. Saw one posting on how to dynamically create a cached image...I could use different event handlers in the initial view, then load individual images from the mime library at that point...cache it into a hard-coded image name...then just call the identical view every time. Not sure this is even possible...input?
    I don't know specifically how to implement any of these options, or know if there are other/better ways. Any help would be appreciated.

    Just create a context attribute "imageFileName" in the component controller or a custom controller, map this attribute from both views (the one that contains the buttons and the one in the popup window that displays the image).
    Now you can have an separate action for each button or one common action. In the first case just set the "imageFileName" inside the action handler for the specific button. In the second case use an action parameter "buttonId" and a parameter mapping
    button.mappingOfOnAction().setParameter("buttonId", button.getId());
    to determine which button triggered the action. After having checked which button was pressed, set the "imageFileName" accordingly.
    Armin

  • Table events lost after opening a popup window

    In an advanced table , I have a column which shows a link. If this link is clicked , a new window opens which displays a popup window.
    If the link is not clicked , I can traverse through the advanced table.
    If I click on the link, I cannot navigate through the Advanced Table, The show hide does not work.
    The new Window is being shown for the link using
    a. A OALinkBean
    b. The link bean Destination property is set using OA.jsp?xxx
    c. The target frame is set to _blank.
    Any suggestions on what could be the problem?

    The pop up page is a read only page or ur doing some action events on the pop up page?Are you simultaneuosly doing action on pop up and base page?
    --Mukul                                                                                                                                                                                                                                                                                                                                                       

  • Input Text in a row of a table is not getting focused after PPR

    Hi All,
    I have a use case where the form will have a table and one of the columns will have inputtext and the other column will have outputtext. Once the user enters some data in inputtext and presses the down arrow, i am using autosubmit and valuechangelistener to call some method in bb which will show popup in the page. And after selecting some value from popup, i close the popup by setting the first row's outputtext with some data and wants to make the cursor focus to the next row's inputtext.
    Its working without PPR, but when we use PPR to set the outputtext component, its failing the focus is getting lost. Any ideas would be helpful.
    Regards,
    N

    Hi,
    Check following will helpul
    http://blogs.oracle.com/jdevotnharvest/entry/how_to_programmatically_set_focus

  • Why h:commandlink action not get fired after upgrading to JSF-1.2_12?

    Hi,
    One strange behavior that I'm facing right now after upgrading to JSF version1.2_12, is that the action method for hidden commandlink which should get fired on changing the value of a comboBox are not getting fired. Note that I was initially using the JSF1.2_07 version and it worked fine.
    Any help would be much appreciated.
    Here is a sample code of what I have in my app.
    <h:panelGroup>
                   <h:selectOneMenu id="nav-menu" value="#{customBean.rowName}"
                   onchange="submitOnMenuChange(this.form,'id-link', 'nav-menu');">
                   <f:selectItem itemLabel="Select:" itemValue="" />
                   <f:selectItem itemLabel="rowName1" itemValue="rowName1"/>
                   <f:selectItem itemLabel="rowName2" itemValue="rowName2"/>
                   </h:selectOneMenu>
                   <h:commandLink id="id-link" value=" " action="#{customBean.updateAction}" style="display: none;"/>
    </h:panelGroup>
    Inside submitOnMenuChange() I'm using below technique to submit the form
    var idclValue = formId + JSF_ID_SEPARATOR + elementId;
    jsfcljs(document.forms[formId],idclValue+','+idclValue,'');
    So, ideally on changing the value from above comboBox it should invoke the updateAction method, bit it doesn't.
    Thanks,
    Umesh
    Edited by: Umesh_S on Oct 7, 2009 4:47 AM

    Here is a small simple example which could help replicate the problem
    There are mainly three files: 1. displayPage.jsp 2. CustomBean.java 3. faces-Config.xml
    1. displayPage.jsp (content)
    <%@ page session="true" contentType="text/html;charset=utf-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html>
    <head>
    <script language="javascript">
    function submitLinkAction(formId, elementId) {
         if (document.forms[formId] != null) {
              var idclValue = formId + ":" + elementId;
    jsfcljs(document.forms[formId],idclValue+','+idclValue,'');
         } else {
              throw "Form with id [" + formId + "] is null.";
         return false;
    function submitOnMenuChange(thisForm, linkId, menuId) {
         var fullMenuId = thisForm.id + ":" + menuId;
         var menu = document.forms[thisForm.id][fullMenuId];
         var selectedValue = menu.options[menu.selectedIndex].value;
         if (selectedValue.length > 0) {
              try {
                   return submitLinkAction(thisForm.id, linkId);
              } catch (errorMsg) {
                   alert("Error occurred: " + errorMsg);
         return false;
    </script>
    </head>
    <body>
    <h:form id="edit-form">
                             <h:panelGroup>
                                  <%-- show select drop-down--%>
                                       <h:selectOneMenu id="nav-menu" value="#{customBean.rowName}"
                                            enabledClass="grid"
                                            onchange="submitOnMenuChange(this.form,'nav-link', 'nav-menu');">
                                            <f:selectItem itemLabel="Select:" itemValue="" />
                                            <f:selectItem itemLabel="Row1" itemValue="Row1"/>
                                            <f:selectItem itemLabel="Row2" itemValue="Row2"/>
                                       </h:selectOneMenu>
                                       <h:commandLink id="nav-link" value=" " action="#{customBean.updateAction}" style="display: none;"/>
                             </h:panelGroup>
    </h:form>
    </body>
    </html>
    </f:view>
    2. CustomBean.java
    public class CustomBean {
    private String rowName;
         public CustomBean() {
         public String getRowName() {
              return this.rowName;
         public void setRowName(String value) {
              System.out.println("** Inside set row name**");
              this.rowName = value;
         public void updateAction() {
              System.out.println("************This is action method for hidden command link************* ");
    3. faces-config.xml (content)
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
         <managed-bean>
         <managed-bean-name>customBean</managed-bean-name>
         <managed-bean-class>com.examples.CustomBean</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         </managed-bean>
    </faces-config>
    So, if we run above example on JSF 1.2_07, on changing the value of nav-menu, it should submit the form and the action method (updateAction()) defined for commandlink "nav-link" should get fired (one could see the System.out coming on the console) but the moment the JSF jars are upgraded to 1.2_12 the action method no more gets invoked.
    Thanks,
    Umesh

Maybe you are looking for

  • BP Validation

    Hi all, i am doing BP validations for BP type. Upon validating and there is and error, all screen fields are greyed out hence restricting the user to enter correct data. The only way now is to cancel the transaction and execute it again which is a bi

  • How do I NOT view PDF files in Safari?

    When I click on a PDF link on a webpage in Safari it no longer opens by downloading or opening in Preview. Now it opens a new tab, all in gray and displays the message that I must quit Safari, open Adobe Reader, and accept a license agreement to view

  • Third Party Plug Ins & RAM

    Hi Guys My MBP is about a year old now with 2GB RAM and 2.4 GHZ processor. Until recently I have been running Logic very nicely for my needs, generally 15-20 audio or software instruments tracks with overloading a rather rare occurance. This is with

  • Colors not displaying properly

    Lightroom displays my Canon RAW files with a yellow tint over them. However, when the file is exported to jpeg from Lightroom, the file looks fine. The file also displays properly in all other programs including DPP and Photoshop. http://www.petelope

  • Duplicate pictures on iPhoto

    I'm looking for input/suggestions to eliminate duplicate photos.  While importing from a CD, there was an occasional "pop-up" window to alert me to a duplicate. However it was not consistent & I find I have hundreds of duplicates.  I read through pre