Howto refresh table after closing a popup

Using JDev 11.1.1.3
I have a table and a popup. The table is populated by records from a datacontrol.
The popup has a form showing details of the selected record in the table. I also use that popup to create new records.
I have problems when pressing the "OK" button on the dialog. The record is saved to the database, a commit has been executed but my table does not show the new record. I need to press F5 before i see the record.
I have tried setting a partialTrigger to the table from the popup but that does not work.
This is the dialogEvent code:
    public void enqueteListener(oracle.adf.view.rich.event.DialogEvent dialogEvent) {
       if(dialogEvent.getOutcome() != DialogEvent.Outcome.no) {
         BindingContainer bindings =  BindingContext.getCurrent().getCurrentBindingsEntry();
         OperationBinding operationBinding = bindings.getOperationBinding("Commit");
         operationBinding.execute();
         operationBinding = bindings.getOperationBinding("Execute");
         operationBinding.execute();
       else {
         BindingContainer bindings =  BindingContext.getCurrent().getCurrentBindingsEntry();
         OperationBinding operationBinding = bindings.getOperationBinding("Rollback");
         operationBinding.execute();
    }As you see the commit gets executed and after that i execute the Execute to refresh the table but it does not seem to work...
How can i achieve that i do not longer need to press F5 so the record show up directly in the table after the OK button is clicked in the popup?

Hi,
you may add this helper method to your basking bean (or base backing bean)
public void refreshUIComponent(UIComponent x) {
        AdfFacesContext.getCurrentInstance().addPartialTarget(x);
}When using the addPartialTarget on your adf table component, it will refresh the table entirely.
With the "fetching data....." message etc... (It is a bit heavy)
What would be nice, is to refresh only the current row and not the whole table.
How ?
protected void refreshTableCurrentRow(RichTable xTable) {
        //Refresh Table UI Current Row
        Set<Object> selectedKeys = xTable.getSelectedRowKeys();
        assert selectedKeys.size() == 1;
        Object old = xTable.getRowKey();
        try {
            xTable.setRowKey(selectedKeys.iterator().next());
            List<UIComponent> colList = xTable.getChildren();
            Iterator iter = colList.iterator();
            while (iter.hasNext()) {
                UIComponent col = (UIComponent)iter.next();
                Iterator iterCol = col.getChildren().iterator();
                while (iterCol.hasNext()) {
                    refreshUIComponent((UIComponent)iterCol.next());
        } finally {
            xTable.setRowKey(old);
    }And call it just after executing the "Execute" operation
operationBinding = bindings.getOperationBinding("Execute");
operationBinding.execute();
refreshTableCurrentRow(getTable());
Regards
Nicolas

Similar Messages

  • 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

  • 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

  • Windows 8.1 desktop refresh required after closing mstsc

    In Windows 8.1 Pro with Update (64-bit), in desktop mode, after closing the mstsc app (click X in title bar) during an mstsc session to a Window 7 Ent SP1 workstation, the contents of the mstsc window remain displayed and a desktop refresh (right-click->refresh
    on the desktop) is required to refresh the desktop to clear the stale content from the display. This does not happen when using mstsc to connect to a legacy Win XP Pro workstation.
    Video adapter is an integrated Intel P4600/P4700 with latest drivers provided my Microsoft Update (v10.18.10.3621) in multi-monitor (3 monitors) mode. The mstsc is only active on one monitor.
    Anyone else seen this issue?

    Monitor refresh rate (all 3 of them is set to 60hz). Only options on the primary display are 59 or 60Hz.
    Setting the refresh rate to 59Hz produces same results. Setting back to 60Hz produces same results.
    Sometimes part of the desktop on the monitor with the mstsc window needs to be refreshed, sometimes all of it under the mstsc windows needs to be refreshed, and sometimes, but rarely, the desktop never needs to be refreshed after closing mstsc to this specific
    target.
    The mstsc session is not a full screen session and is opened as per:
    C:\Windows\System32\mstsc.exe "<path to rdp file>.rdp" /w:2560 /h:1530
    on a 30" display set for 2560x1600, 32bpp, 60Hz
    To clarify, the specific issue manifests when I disconnect the session -- ie. clicking the X in the title bar, then clicking OK in the dialog "Your remote session will be disconnected". The "Your remote session will be disconnected" dialog
    disappears (sometimes), and the mstsc windows title bar disappears but some or all of everything else that was inside the mstsc windows (from the remote system) remains displayed (even the mstsc bottom window border) until the desktop is refreshed.
    I do note that if I set the mstsc session to full screen and then close/disconnect the session while it is in full screen, that the refresh required after disconnect issue does not manifest.
    I am not sure if this is a functional issue in the mstsc client in Windows 8.1 (file version 6.3.9600.16384) or is more generally display/explorer specific. If the issue is broader, I am only noticing it with mstsc.
    I've also updated to the latest Intel HD Graphics driver (rel: 2014-08-29) and no difference.

  • Adf refresh table after popup

    I have a search page with a deep link to a page showing detailed information about the selected search result. From the detail page I open up popups to enable the user to change some of the data. When returning from the popup the detailed information is not refreshed. To fix this I have added a backing bean and calls it from the returnListener.
    The problem is that the detailpage does not show the changed data. If I call the popup a second time and then just exit it the detail page then finally shows the changed data.
    Any idees on why this happens ?
    In the logg I get
    08/08/07 11:10:35 [2246] Reusing a cached session application module instance
    And
    oracle.jbo.JboException: queryByKeyValue: Argument Key Value cannot be null
    Mette
    <af:commandLink id="StartVeiEndreLikningsopplysninger"
    text="#{nls['TABLE_TITLE_VEIENDRELIKNINGSOPPLYSNINGER']}"
    action="dialog:StartVeiEndreLikningsopplysninger"
    useWindow="true" partialSubmit="true"
    launchListener="#{DialogLaunchHandler.handleDialogLaunch}"
    disabled="#{processScope.inInfoEiendom!= 'true' or jhsUserRoles['SERG_LES']}"
    windowWidth="1100" windowHeight="600"
    returnListener="#{backing_show.backFromPopup}">
    <f:actionListener type="oracle.jheadstart.controller.jsf.listener.DoRollbackActionListener"/>
    <f:actionListener type="oracle.jheadstart.controller.jsf.listener.ResetBreadcrumbStackActionListener"/>
    <af:resetActionListener/>
    </af:commandLink>
    public void backFromPopup(ReturnEvent returnEvent)
    EL.set("#{requestScope.veiviser}",true);
    FacesContext context = FacesContext.getCurrentInstance();
    String currentView = context.getViewRoot().getViewId();
    ViewHandler vh = context.getApplication().getViewHandler();
    UIViewRoot x = vh.createView(context, currentView);
    x.setViewId(currentView);
    context.setViewRoot(x);
    try { FacesContext.getCurrentInstance().getExternalContext().redirect("http://159.216.138.187:8989/SergWebApp-ViewController-context-root/faces/pages/InfoEiendom.jspx");
    FacesContext.getCurrentInstance().renderResponse();
    catch (IOException e) {
    System.out.println("test");
    Part of the pageDef.xml.
    <executables>
    <invokeAction id="queryByKeyValueInfoEiendomInvoke"
    Binds="queryByKeyValueInfoEiendom" Refresh="prepareModel"
    RefreshCondition="#{jsfNavigationOutcome=='DeepLinkInfoEiendom'||requestScope.veiviser}"/>

    I also got it working by setting CacheResults'"false" in the page def, but now I am getting the following:
    oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel makeCurrent
    WARNING: ADFv: No row found for rowKey: [oracle.jbo.Key[31 ]].
    Edited by: user13378799 on Sep 13, 2010 10:25 AM

  • 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.

  • Refresh table after creation of new Toplink BO

    Hi,
    i have the following Problem and i hope someone can help me. I use ADF11g/Taskflows with TopLink-mapped BOs (no ADF BC).
    Consider following Taskflow(s):
    main activity is a jsff-page (view) showing a table of BOs. From this view there are two action-outcomes defined called "edit" and "create". The edit-action calls another Taskflow constisting of one pageFragment showing the detailForm of the given BO. This Taskflow has one input and one output parameter (the BO to edit) and has two exists called "save" and "cancel". The add-Action calls a Method called "createNewBO" first and then calls the mentioned Taskflow also. Every Taskflow has ist own managed Bean in the pageFlowScope working as a Controller and DataControl for the TaskFlow and directly included views.
    The edit-action works fine. The add action also except that the table from the default activity of the first taskflow does not refresh after return from the second Taskflow. I tried to set the Refresh-Property in the PageDef to all possible values in combination with the RefreshCondition but no combination works. I can make a manual refresh or change the sorting then the new BO is shown in the table.
    Is there a possibility to call a refresh of a jsff from a taskflow or can i force the refresh on entering the jsff?
    I'm really stuck and appreciate any help ;)
    Friedrich

    You can try this:
    - on your taskflow diagram select the page that contains the table you want to refresh, and add a Page Parameter (from #{true} to #{viewScope.refresh})
    - in pageDef for that page add one invokeAction in executables and point it to methodAction that fills the iterator you want to refresh
    - for newly created invokeAction, set Refresh to ifNeeded and Refresh condition to #{viewScope.refresh}
    This should refresh the iterator each time the page (fragment) is loaded.
    Hope this helps!
    Pedja

  • 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"

  • How to invoke task flow navigation after closing inline popup?

    Using JDev 11.1.1.3; I have a commandButton that currently executes task flow navigation when pressed. I need however to invoke an inline popup from the button press before executing (conditionally) the task flow navigation. The Action setting on the button then needs to be removed, but it's not clear where to reinstate it. I have the button executing some managed bean code, which conditionally invokes the inline popup, and when the popup (contains af:dialog) is closed, I have some more managed bean code that determines whether the task flow navigation should occur or not. What I need to know is how to fire off the Action from the managed bean. Any suggestions?
    Thanks,

    1. To add to Timo's solution:
    you can call those code from DialogListener like:
    public void dLstnr(DialogEvent dle){
    if("ok".equalsIgnoreCase(dle.getOutcome().toString())){
    FacesContext context = FacesContext.getCurrentInstance();
    NavigationHandler nh = context.getApplication().getNavigationHandler();
    System.out.println("1");
    nh.handleNavigation(context, "", "go");
    2. As another solution:'
    you can have custom buttons and on one of then (say OK or Yes) you can call bean method like this as Action:
    public String actionMethod(){
    // DO YOUR LOGIC
    return "NEXT_TARGET";
    for Other button (say Cancel, NO) just close the popup.
    Amit

  • 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

  • How to refresh the table after change value in the VO programatically?

    Hi,
    I like to update my table by using a popup. My problem is that the table does not refresh after I change the value in the table's VO by the popup.
    There is another table in the popup, and the popup is triggered by a command button. An af:showPopupBehavior is nested in the button. The method of the button in backing bean is as following,
    public void accountcodeButtonClicked(DialogEvent dialogEvnt) {
    ViewObject volisttable=am.getAcChartValidateView1();
    String nowcode=volisttable.getCurrentRow().getAttribute("Code").toString();
    ViewObject vobasetable=am.getGlDetailView1();
    vobasetable.getCurrentRow().setAttribute("AccountCode",nowcode);
    The partialTrigger of the base table's column AccountCode points to the triggering button.
    I do not know why the base does not refresh after the above method is executed.
    Please me.
    Stephen

    Hi,
    kind of a shame that after so many years of ADF the message that updates should be through the binding layer hasn't gone through ;-)
    You change the underlying business service, which doesn't impact the binding layer the way you do it. So here is what you can try in the same order
    - 1. RequestContext.getCurrentInstance().addPartialTarget(<table reference>)
    - 2. If 1. doesn't show the changed data, try and re-execute the iterator that is the base of the table. If this works then the effect you see is caused because you ignore using the binding layer
    Frank

  • Maintain the current row position of a table after refresh.

    Hi,
    I use a poll to refresh tables continuously. when a table is refreshed, the current referring row is reset.
    To maintain the current row position after a refresh I use the following poll method.
    public void refreshTableT1(PollEvent pollEvent) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ValueBinding dcb = fctx.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bindings1 = (DCBindingContainer) dcb.getValue(fctx);
    DCIteratorBinding dciter = bindings1.findIteratorBinding("<VOIterator>");
    if(dciter!=null){
    if(dciter.getCurrentRow()!=null){   
    Key current_row_key = dciter.getCurrentRow().getKey();
    dciter.executeQuery();
    if(current_row_key!=null){
    try{
    dciter.setCurrentRowWithKey(current_row_key.toStringFormat(true));
    }catch(Exception ex) {
    System.out.println("Exception in current_row_key");
    }This works for normal tables well. But when I use it to master-detail tables (pair of tables) it does not.
    At the master-detail tables, before the first data fetch, it works well. if we go below the first data fetch, it sets the current row into another position.
    how can I overcome this...??
    Thanks,
    Dinuka.

    Hi Mr.Frank,
    I have an association in two VOs.
    for example: There are 2 tables called Emp and Dept. Every Department has Employees. so there is an association (both tables have a common column). Master table is the Dept table. when you click on one record of the Dept table Detail table will show the details of the employees belongs to that selected department. That's what I referred as master-detail tables. first one is master table; second one is detail table.
    When the web page loads all the table data is not fetched from the db (it will depend on the fetch size). when we scroll down the table data fetch happens again and again.
    think my data fetch size is 25 rows per time.
    Suppose we use mine poll method and think I have clicked on the 20 ^th^ row of table1(master table). then the table2 will display details belongs to selected department. that is OK even after refresh. that works well.
    when I go to 30 ^th^ row data fetch will happen (my fetch size = 25)
    when I click on the 30 ^th^ row of the table1(master table), table2 will display details belongs to selected department. but after the poll method is called the selected row at the table1 disappears and is set to another position. now the 30 ^th^ row is not in the 30 ^th^ position. but it is the selected row and table2 displays correct details.
    I think you have got the problem now. :D
    Thanks a lot.
    Dinuka.

  • How to pass the selected table row data from popup to source view

    Hi ,
    I have requirement of passing the data from popup view to source. , searching some data in  popup view and displaying in table,
    Like i am passing some input and click search button will display the data in table, when select any of the row in the table and click on the another button , i should be able to pass the select row to the source view and also should close the popup.
    When i implement , In the popup windiw, when i enter the customer no, and click on search button, it is closing the popup itslef. not able to see the data in popup.
    Can u tell me what is that soultion.
    Regards
    Vijay

    Hi Harsimran
    Thanks for the reply,
    1) Source view
    In  "Source View" i have input field called Customer_no. But,  the end user will not have any idea , what customer no to enter. so i am searching the customer no in the popup view.
    1) Customer_no( This is an inputfiled , to get the customer no from the popup view)
    2) Get Customer NO( This is a button to call the popup view)
    "Get Customer NO" This button action will open the popup view.
    In this popup, i have
    1) Input field (To enter the search term)
    2) Search (To seach the customer no based on the search term)
    3) Table ( To display the search data)
    4) Button in Table tool bar called "Select" .( To close the popup view after selected the required data in the table to pass it back to the source view).
    so in the popup view what happening is, when i click on the search button itself , it is closing the popupview  by transfering the first row of the tbale ,with out select the required row in the table.
    i need to close the window after click on the "Select" button in the toolbar , after selected the required row data to trasfer in the table.
    Can u pelase tell me what are the modifcations i need to do it.
    Regards
    Vijay

  • ALV table not displayed in Popup

    Hello Experts,
    I have created a view which contains an ALV table. This view is embedded in one window.
    I am opening this window on click of a button. I am reading data from one custom table and displaying it in ALV.
    The problem I am facing is that ALV displays the data the very first time window is opened. After closing the window if we again open the window the ALV table is not displayed.
    I have checked the code in debugging and values are coming in Node but not displayed. There is no visibility property attached to this ALV.
    Every thing was working fine until patching was applied. The same code is working fine in prod but in Dev I am facing this issue.
    Can any one you guys suggest me that why it is happening? Is it because of Patch upgrade  and is there any sap note to resolve this.
    Thanks in Advance
    Amit

    Hi Khandelwala,
    Is the entire ALV table disappearing? as it is a popup, the view will always be destroyed when the popup window is closed. It will be again recreated once the popup window is thrown again.
    However the component controller instance will not be freed and will exist.
    My guess is some plugs are being fired displaying empty view.
    Please let us know if it is only data that is disappearing.
    Just check the stack level of ur dev and production landscapes. If Dev is on higher version, then it might be due to patch.
    Thanks,
    Anand

  • Can not refresh page after save properly(When not saving master record)

    I am using jdeveloper 11g R2 (11.1.2.3) JSF Facelet
    In some use case I have Address as master table and Person as detail table
    For some business reason I need to don't save same addresses
    eg:
    If +1 Test St+ is in database already and new user coming and adding this address with new person
    I need to use the row in database not creating a new address
    I do saving in doDML method of Address with some hashing algorithm and it is fine
    My problem is that I can not refresh page after save properly
    User coming to page think Adding a new address and a new person but in fact no new
    address added because of business I describe above
    Any ideas how I can implement this?
    Appreciate that
    Regards
    Mohsen

    Hi,
    from your description it is not clear why the page doesn't refresh. It could be a problem in your implementation code - who knows. What if you perform the address check on a command button that actually submits the new address? If the check returns true (address exists) you would call row.refresh(forget new row); and re-query the view object so the address coming from the database is displayed. If you wanted to use the doDML then yuou need to be aware that doDML doesn't help removing the row the user created. It just ignores the database update but the entity is still around, which in my suggested solution wont be the case.
    Frank

Maybe you are looking for