Refreshing a region

In our product a Browser refresh does not refresh the regions present in the page , it uses the old state of the regions. Is there any way that browser refresh also reinitialize the regions of the page ?
If its not possible as an alternative we can provide a refresh button as a Global link on all the pages of the product which onClick calls the refresh method of all the RichRegion present on that particular page,
but the problem is how to get hold of the Region Components present in the page?
Hard Coding the refresh method for all pages wont be a good option. We want to write a generic code which finds the region components present in the page and call its refresh method.
Anybody has any pointers regarding how to achieve it ?

Hi Frank
Yes we are using ADF. Currently Refresh condition is null, and all other parameters are set as default.
If the browser uses the client cache then we have to provide the refresh button. So is there any way to know all the regions present in a particular page, so that we can call the refresh method.
We have bindings of all the regions and the viewID of the current page.

Similar Messages

  • Refresh two regions at a time

    Hi,
    Iam new to ADF Framework. Using JDeveloper 11.1.1.5.0. Following is the high level description of our requirement.
    I've JSF page with four regions localted at left,Center, Bottom & Right. Left region having three buttons. Based on button click, center region will be populated with corresponding tree. User can select the required elements from the each tree & then click on 'Submit' button (which is in Center region).
    As of now Iam able to achieve till this part with the help of " Programmatic Partial page refresh (PPR) with dynamic regions »http://asktown.co.uk/?p=223"
    Now the pending part is, If user clicks on 'Submit' Button then need to send the selected item references to bottom region & right region at a time to do some thing. i.e Bottom region will display the selected items and right region will perform calculation part.
    There are two things pending as I know
    1. Getting the selected nodes from three trees(Each botton will display separate tree in center region)
    2. Refreshing two regions (bottom & right) at a time with Submit click.
    Ihope, If i could achieve these two things,Iam almost done with my task.
    Can you provide hint to proceed on these two things. It would be helpful, if some one provide pointer to achive this task.
    Thanks in advance,
    MSR.

    Hi,
    if you use shared data controls then this is not so difficult to achieve. Here's what you would do
    1. http://docs.oracle.com/cd/E23943_01/web.1111/b31974/web_masterdetail.htm#sthref2108 --> "Using the TargetIterator Property" explains how to synchronize iterators with the selection in the tree. Say the tree has locations, departments and employees. Then when you click the employees node, a employees iterator is synchronized
    2. For each iterator used or referenced by the tree create an attributeValue binding for the value you want to pass on to the other regions
    3. the region input parameters of the two regions to synchronize point to a managed bean in view scope. The refresh condition is set to if needed on the task flow binding so that when the input parameter value changes, the region restarts the contained task flow
    4. See http://www.oracle.com/technetwork/developer-tools/adf/learnmore/50-synchromize-form-treeselection-169192.pdf (--> page 6, "Building the Custom Selection Listener"). Change this code so that whenever a user selected a tree node you
    i) retain the default functionality
    ii) determine the selected node and read the attribute value binding for this node. Say the node is employees and the attributeValueBinding you created is for EmployeeId. Then the code looks like
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    AttributeBinding attr = (AttributeBinding) bindings.get("EmployeeId);
    Object selectedNodeValue = attr.getInputValue();
    5) Set the selectedNodeValue to the managed bean property referenced from the region input parameters
    6) Call AdfFacesContext.getCurrentInstance().addPartialTarget(region reference) for each region
    7) The last thing to consider is that the tree is in a region itself. So here is some complexity that you handle following the idea mentioned in this blog (http://one-size-doesnt-fit-all.blogspot.de/2010/09/master-child-btf-chaperone-contextual.html)
    Since the two dependent regions are refreshed by the parent view, you need to define a managed bean in view scope for the parent view and then pass the bean as an input parameter reference to the region having the tree component. You use this handle then to pass the selected EmployeeId and the partial refresh notification to the view bean. The bean then sets the managed bean property read by the task flows in the dependent regions
    Frank
    Ps.: This is a very complex use case for a start with ADF
    Frank

  • How to refresh a region during tab change

    Hi All,
    In my page I have two tabs.There is one region each in each tab.
    Tab 1 region is on top of Parent View Object and Tab 2 region is on top of Child view object. Relationship is one-to-one.
    In tab 1 region, If populate some attributes <of ParentVO> then, those attribute values will be copied to the Child View Object by calling an AM method from the tab disclosure listener.
    When I switch from tab 1 to tab 2 for the first time all the populated attributes < Parent VO in Tab1 > are getting copied to child VO and I can see those values in tab 2 <UI> .
    But after that when I switch back to Tab 1 and change some attributes and go to tab 2 then, the newly populated attributes are not shown in the second tab.
    But If I go to the next page and come back to the same page then in the second tab I can see all the newly populated attributes..
    refreshCondition of the task-flow is ifNeeded.
    In my disclosure listener I am trying to refresh the region binding programmatically. <AdfFacesContext.getCurrentInstance().addPartialTarget(regionbinding)>.
    But the region in tab 2 is not getting refreshed.
    Please Help...
    Am I missing some thing here...

    Thanks a lot for your response...
    Earlier I had tried #{true} as refreshCondition. But that didn't help. And I had tried changing an input parameter value by calling a bean method [toggleValue: which will toggle the parameter RefreshFlag ]
    and keeping the refresh Condition as ifNeeded. But in this case it didn't work. Earlier I had tried this approach and it was always working.
    Now I will try with the option you gave me.. Calling refresh method of UIXRegion. The method seems to be the exact one which I was looking for from the doc.
    The documentation says...
    refresh
    public void refresh(javax.faces.context.FacesContext context)
    Refreshes this region's model. This method calls RegionModel.refresh(javax.faces.context.FacesContext), and adds this region as a PPR target. This method must only be called during PhaseId.INVOKE_APPLICATION phase. A RegionNavigationEvent is always queued.
    So can I call this method on a tab disclosure listener..?
    Or Do I need to check for the Phase and call this method.. It would be great if you can make it a bit more clear.
    Do I need refresh or refreshCondition along with this approach..
    Thanks a lot..
    Abhilash

  • Can't refresh a region after DHTML Dialog close?

    Do someone have experience with DHTML Dialog plugin?
    I can't refresh a region on a parent page after Dialog closes!
    I have created a dynamic action on a parent page, using a Close[DHTML Dialog] as a event
    Is there other way to refresh a region or an item on a page after the dialog close? Maybe with javascript?
    I need to force the page item to get a new value from the database.
    Thanks!

    I haven't used that Plugin , but from the plugin explanation it is said(as you mentioned) that you can use the Close[DHTML Dialog] event for Dynamic Actions.
    I am not sure if the event is actually triggered before the dialog is closed or immediately after. If this event has been implemented as a callback , then its probable that the event would be triggered after the dialog is closed.
    In any case, you can add a simple javascript alert code as the Dynamic Action and see if it runs fine.If that works you can add the region refresh javascript code manually as
    $('#REGION_STATIC_ID').trigger('apexrefresh')if that doesn't work, its probably due to the call happening from the dialog(before it closes) and the dialog unable to find any such element (since its attached to the dialog's parent)
    in such a case, use
    parent.$('#REGION_STATIC_ID').trigger('apexrefresh')This refresh method only works with report regions(and some LOV item types) , so for most page items you have to call some javascript that specifically fetches and sets the session value (either using ajax or new value passed from modal )
    Instead of using the plugin for the dialog, if you use the jQuety dialog API (which I guess the plugin calls internally) , then it has close event where you can add your custom code. You can find the API documentation here

  • How to refresh a  region using Active Data Service

    Hi,
    I need to refresh the region using ADS.
    I am creating jsff which contains dynamic tables rendering. This jsff is bound to a task flow (having input parameter and refresh property set to "ifNeeded). The bounded task flow is dropped on a jspx as a region.
    Now in order to refresh the region, I need to pass the updated param value, which would cause the region refresh.
    I am able to do so on a button click from jspx page. But I have to make it auto refresh using ADS as per app requirement.
    The issue is "AdfFacesContext.getCurrentInstance return null..if I am using it in startActive Data or changeData Update (where I am using ActiveDataUpdateEvent)".
    Please guide me how can I achieve this.
    I am using Jdev 11.1.1.4.
    Thanks.
    Edited by: 977455 on Jan 3, 2013 7:35 PM

    Hi,
    try a variation of this blog entry: http://matthiaswessendorf.wordpress.com/2010/01/22/flexible-active-data-service/
    Instead of showing a popup, you do the following
    1. set clientComponent=true for the hidden field
    2. configured the PartialTrigger property of the region to point to the hidden component
    If this doesn't work then try this
    1. use <af:clientListener type="propertyChange" method="activeDataCallback" /> as used in the sample
    2. define an af:serverListener that points to a managed bean that has access to the region (RichRegion) instance
    3. The af:serverListener needs to be defined as a child of the outputText
    4. change "activeDataCallback" to queue the server listener event (CustomEvent)
    5. Use the managed bean to refresh the region
    Frank

  • Refreshing a region, Rich Region.refresh or addPartialTarget ?

    Hi All,
    I have a question about refreshing a region.
    Assume that a region is bound to a backing bean property (RichRegion myRegion). And getMyRegion() is the getter for the region in backing bean.
    What I want to know is the difference between using getMyRegion().refresh(FacesContext.getCurrentInstance()) and AdfFacesContext.getCurrentInstance().addPartialTarget(getMyRegion()). And under which situations, these methods should be used?
    Could you please help me telling the difference? Thanks a lot.
    Best Regards,
    cmoster

    Hi,
    good question!
    1. AdfFacesContext.getCurrentInstance().addPartialTarget(getMyRegion())
    This performs a UI refresh of the region, which means the region is only re-rendered. This may not have any impact to the state of the task flow exposed in a region unless the task flow binding has its refresh option set so the task flow re-initializes. You use this option to refresh task flows in regions if you use shared data control (in which case the data content displayed in the region refreshes without the view displayed in the region to change). You can also use this to re-initialize a task flow (which means you restart it so its default activity is executed). You do this by setting ifNeeded as the refresh option and ensuring an input parameter of the task flow binding to be changed. Or, you use the refresh option as "default" but have a refreshCondition EL defined that returns true for a full task flow refresh
    2. getMyRegion().refresh(FacesContext.getCurrentInstance())
    While 1) is fully declarative, this is programmatic invocation that always refreshes the region such that the task flow exposed therein is restarted (executing the default activity). The method also adds the component to a list of partial refresh targets. This method must be called during JSF INVOKE_APPLICATION phase, which means it is to be used from an action event and not a component event like value change.
    Frank

  • AddPartialTarget doesn't refresh the region

    Hi,
    i have a region where a taskflow is consumed. After doing some update through the ui page , the values in main page remains but the values in the region disappears.
    when i press F5 the data in region comes in page. However through code when i do addPartialTarget(), then the values still don't come.
    Can anyone please suggest in this?

    Hi,
    Are you using contextual event to update the data?
    If so, need to add partial trigger in handeling function.
    In any way you can try to add the partial trigger to some of the containers the component you need to refresh.
    That what helped for me.
    Nina

  • Contextual Event Automatically refreshing child regions

    Hello,
    Here's my dilemma. We have an ADF page fragment that contains three regions(which point to 3 different bounded task flows). Lets call the bounded taskflows btf1, btf2, and btf3.
    What currently happens is we use contextual events to create communication between (btf1 and btf2) and communication between (btf2 and btf3)? We do not have contextual event that would allow communication between btf1 and btf3.
    So we currently have this communication working. Hence, when I hit a button in btf1, it fires off a contextual event, such that btf2 is refreshed. But what is happening here, is that btf3 is also being refreshed. We DON'T want THIS... We only want btf3 to be refreshed from an event that is fired from btf2.
    Question. Is there a way to restrict ADF from refreshing btf3 everytime and event is fired from btf1.
    In general, it seems as though all regions are being refreshed everytime a contextual event is fired. We don't want this. How can disable this from happening? We have checked all of wiring. There is no connection between btf1 and btf3.

    Try creating the event mapping - please see "28.7.2 How to Create Contextual Events Manually" in Dev Guide http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/web_adv.htm#CACJBFGI

  • Problem Refreshing Dynamic Region

    Hi ,
    I am facing problems in refreshing the dynamic region. Here is the usecase :
    One JSPX page : TestDynamicTaskflow.jspx
    First Taskflow : LinksTF -> Has one page with 3 command Buttons and one dynamic region.
    On click of 1st and second command button link tf-1 should be displayed and for third command button  tf2.
    Second Taskflow : tf-1    -> Taskflow has one jsff page with a inputText field ( required = true )
    Third taskflow : tf-2  -> Taskflow has one  jsff page with a inputText field ( required = true )
    Problem : Click 1st command button and tf1 is loaded. Now enter some value in inputText and click commandButton2 ... tf-1 is loaded but inputText retains the entered value... This is what is issue .

    Hi,
    the task flow is reloaded as you should be able to tell when setting a print message to be invoked in the task flow initializer. I assume the problem is with the text component not resetting its value. So its a JSF lifecycle problem, not a region issue. Have the command link switching the task flow, issuing
    oracle.adf.view.rich.util.ResetUtils.reset(regionId_in_here);
    Frank

  • Error when refreshing report region: ORA-20876: Stop APEX Engine

    I'm using Apex 4.2. On click of a button, I refresh 2 Standard Region Reports with a Dynamic Action. This dynamic action has been working without problems for WEEKS and all of a sudden i'm getting the ORA-20876: Stop APEX Engine error when I click the button.
    In the dynamic action, I removed the refresh of the second report and now the error does not occur. If I add the second refresh action back in, it throws the above error. I've even tried making the second report identical to the first and the refresh action fails. I don't understand why this is failing on the second refresh action since the second report & region is IDENTICAL to the first report now.
    Please help!
    Thanks,
    John

    I would use something like firebug to see how the AJAX call for the refresh is working. I would want to see what is begin posted and what's being returned from the call.
    That should shed some light on the issue.
    THanks
    -Jorge

  • Problem Refreshing Report Region

    I have a Report Region, based on a SQL Query. It works fine, and returns the records Queried.
    My problem, is that it is not Refreshing, after page Refresh. I even tried Logiing out, and then back in. In my latest attempt, I deleted ALL the records, logged out, and then back in. The prior Report Results were still there. It seems like it is Cached somewhere. The Caching is set to Not Cached.
    I am stumped.
    Please give me advice. Thanks!

    I have seen that only when I thought my query is selecting from a particular table but that wasn't the case. You could create an empty copy of your table and replace the original one in the sql just to see what happens.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Component refresh from region

    Hi All,
    I am using JDeveloper 11.1.1.6.0.
    I have created my ADF page having panelTabbed component (it is not a template). in each tabs, i have dragged other task flows as regions. I have a outputText on the page, which should be refreshing from a button click inside the region.
    How do i achieve that?
    below is the code
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
       <af:pageTemplate viewId="/OverviewTemplate.jspx" id="OverviewTemplate">
          <f:facet name="userOverview">
             <af:panelStretchLayout id="psl1" styleClass="AFStretchWidth">
                <f:facet name="center">
                   <af:panelTabbed id="pannelTabbedOverview"
                                   binding="#{userBean.panelTabbed}">
                      <af:showDetailItem text="Overview" id="showDetailItem1"
                                         stretchChildren="first"
                                         binding="#{userBean.overviewTab}">
                         <af:panelStretchLayout id="overviewtabPSL" topHeight="25px">
                            <f:facet name="center">
                               <af:region value="#{bindings.overviewtaskflow1.regionModel}" id="r1"/>
                            </f:facet>
                         </af:panelStretchLayout>
                      </af:showDetailItem>
                   </af:panelTabbed>
                </f:facet>
                <f:facet name="top">
                   <af:panelBox text="PanelBox1" id="pt_pb1" styleClass="AFStretchWidth">
                            <af:outputFormatted value="#{bindings.userStatus.inputValue}" id="pt_of1"/>
                   </af:panelBox>
                </f:facet>
             </af:panelStretchLayout>
          </f:facet>
       </af:pageTemplate>
    </jsp:root>Here i want to refresh the userStatus value from a button which is inside overflowtaskflow1 region. Please help me out.
    regards,
    Rajan

    set partial triggers to your outputFormatted component as similar to below example...
    partialTriggers="r1:<btn-id>"Since some of the ADF components are naming-container (while generating IDs for child, their presence is considered by appending ID) ... so select r1 from Jdev's partial trigger selection window...and rest of the string you can get from the jsff page in your TF and append both with ":"
    1. Say Jdev shows r1 reference as ":::r1"
    2. Your btn reference inside TF from top component is "pt1:t1:btn1"
    so your partial trigger would become 1+":"+2 = ":::r1:pt1:t1:btn1"
    This is just an example, you might have to compute your strings for ppr.

  • Displaying AJAX refreshed report regions

    Hi,
    Following on from my GetAsync help yesterday I have another question. The next part of the puzzle is I have a tree on the left hand side of the page which, when a node is clicked, causes two reports on the right hand side of the page to refresh. If I use the method described in John's Pro Apex book that works fine.
    However what I would ideally like to be able to do is use the GetAsync method again to allow the browser to remain responsive when a node in the tree is clicked. So far I can either insert the whole page into the div - it works, but isn't exactly elegant, or get an XML document from an application process - but this only displays something like "object: [XML document]" (not exact, I don't have it to hand).
    I have a feeling I've been looking at this too long, I've looked at trying to insert XML with XSL for formatting but haven't yet got that working (again a complete newbie to XML/XSL pretty much which is probably why...), other options I can think of are traverse the XML document and, with javascript, create a table in the DIV (doesn't feel right), or somehow an adaptation of John's method whereby I somehow traverse the DOM grabbing the content between the BOX_BODY tags.
    Any suggestions/ideas gratefully received!
    Many thanks,
    Gareth.

    Ben,
    Haven't tried implementing this either but how about:
    - you have 5 regions on a page, 1 for each report
    - these regions each contain nothing but a div in each case
    - each div initially contains nothing but a "Loading..." animation/images/whatever
    - You have 5 other pages, each of which are based on a blank page template
    - each page contains one report region
    - when your original page loads, you kick off 5 asynchronous ajax requests to these other 5 pages
    - when the the asynch request completes (i.e. when each page has loaded) you replace the contents of the relevant div (the "loading..." animation) with the contents of the other apex page you have just retrieved with ajax.
    I think that should work.
    Or, for more flexibility, you could make Application Processes which generate the HTML for each of your required reports. You could then call these via the Ajax requests instead of calling the 5 new Apex pages. (This would mean that the reports are far less easily changeable, however.)
    Andy

  • Help with how to refresh one region of an APEX 4 page.

    I have tried the options I can find to refresh a single region (classic report) on an APEX 4 page. I want the refresh to happen automatically without any input from a user (no button press, no sorting on the report or anything). Just based on a 5 second interval. Can someone help me further. It seems that I need to either use javascript or jquery. I am not sure where to put this code.
    I have tried the following different methods. I put them in the Region Footer. Not sure if that is the proper place. Nothing happened when I did this.
    Using: Application Express 4.0.2.00.07
    <script type="text/javascript"> 
      <!-- 
        jQuery('#STATIC_ID_OF_REGION').trigger('apexrefresh');
      //-->
    </script>
    <script type="text/javascript"> 
      <!-- 
        setInterval( "$a_report('#REGION_ID#'.substring(1), 1, 7, 7);", 5000);
      //-->
    </script>
    <script type="text/javascript"> 
      <!-- 
        setInterval(function(){ $('#P4_LIST').trigger('apexrefresh'); }, 000);
      //-->
    </script>Thanks.
    Edited by: cjmartin on Oct 13, 2011 2:34 PM

    Hi cj,
    The following works for me. I just chucked the function in global function definition on the page definition.
    var doIt = function(){
    $('#comment_report').trigger('apexrefresh');
      setTimeout("doIt()", 5000);
    }And execute on page load:
    doIt();Edited by: trent on Oct 14, 2011 9:11 AM
    By the way, what is the function $a_report? I can't see any documentation for it: http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21676/javascript_api.htm#CDEEIGFH Is it a supported function?
    Also in your above examples, you set the interval once, but it wouldnt recurr as you're only calling setTimeout once. http://www.w3schools.com/js/js_timing.asp

  • Restricting refresh of region in showdetailItem in panneltab

    Hi experts,
    I'm using Jdeveloper 11.1.2.2.0
    In my page, i have pannel tab with 3 showdetail items & each one has a region.
    The above 3 regions created by same JAR file but when loading tab ,I'm passing 3 different parameters to them.
    But after loading page it appears same out put in all tabs.
    I identify the problem(that is when loding page all 3 regions was executed)
    What i want to do is, when I click the tab,it should be load only the region within it(that is only 1 region).
    Pls give me any suggession.
    Thanks
    Charith

    Some explanation about my post above:
    Taskflow bindings (of the regions) are executed during the PREPARE_MODEL phase of the host page, but the regions are rendered later during the RENDER_RESPONSE phase of the host page, so the execution order is as follows:
    1. Execute TF binding of region 1 (e.g. execute eventual TF method activities, retrieve and lookup data for region 1)
    2. Execute TF binding of region 2 (e.g. execute eventual TF method activities, retrieve and lookup data for region 2)
    3. Execute TF binding of region 3 (e.g. execute eventual TF method activities, retrieve and lookup data for region 3)
    4. Render region 1
    5. Render region 2
    6. Render region 3
    In this way all the 3 regions would render one and same data (the data retrieved and looked up by the 3rd TF binding) if the taskflows share data controls with the calling taskflow (e.g. if they use one and same DC instance). By configuring TF not to share DC with the calling taskflow you would instruct each TF to use its own DC instance.
    Dimitar

Maybe you are looking for