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

Similar Messages

  • 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

  • How to refresh dataservices when underlying table changes

    I'm writing a Flex application using FlashBuilder that accesses several MySQL tables. I've generated data services to access the tables and have used a datagrid to display the data successfully.
    I then realized I was missing a couple of columns in one of my tables. I used phpAdmin to add the columns to the table. When I try to add the new columns to the datagrid, they don't show up in the Bind to Field dropdown. (I am able to type in the new column names, but they don't seem to function in the grid.)
    Looking at the service datatype and code in the Data/Services tab, I can see that they're not showing the new columns. I tried doing a refresh, but they still don't show up.  I've snooped through the code in the services folder and I could try to add them myself. Before I do, I thought I'd better find out if there's a better way.
    Is the data service generation a one-time only type of function or is there a way to have it "re-generate" the data service so as to include any new or changed columns? Any advice on how best to handle this in the future (short of "finish the data model first" )?
    Thanks.

    Do a "Configure Return Type" on the Operation which is bound to the datagrid. Right click on the operation -> Configure Return Type. This will generate a new data type with a new property corresponding to MySQL column.
    Add a column to DataGrid either in Code OR right click on DataGrid -> Configure Columns and add new column with 'HeaderText' and 'Bind To field' values.
    -Radhakrishna

  • How to refresh VO to get the changed value in other AM or backend database

    one VO is refrenced by two AMs, when i insert or update data by VO in one AM, how to get the changed data in another AM ?
    another case is i have updated some attributes of the record in database by SQL statement ,but the client can not get the updated value at once .
    i have tried to use executeQuery() ,but it does not work. now i always do a rollback method ,a bad idea.:)
    pls help me ! thanks
    Message was edited by:
    Guo Qinghua

    Mind that ADF BC (probably like any other persistence framework) caches data. So when you update something in the database other than via ADF BC, you then have in the ADF BC cache what is called 'stale data'. When you try to commit that nevertheless, the database will tell ADF BC that the record in the database has been updated by another user, and a rollback will be done. That is all to be expected.
    You can find some more info on how this works here:
    http://download-uk.oracle.com/docs/html/B25947_01/bcvoeo007.htm
    It also explains how to clear the cache and enforce that data will be read from the database.
    Jan Kettenis

  • How can I prevent pixelization during opacity change?

    I am creating a small WMV ( 197x148 ) which includes a static image and a video clip. I am encountering 2 problems:
    Video has a pixelated edge
    Video opacity change is pixelated, and not smooth
    Any help appreciated - what surprised me is that during the fast preview they look fine, but when they render they get janky. Is there a dithering option I need to disable or somesuch?!
    Thanks in Advance!!!

    Thanks - I tried to include my timeline large enough to read in the second image.
    I adjusted the layer blending property under LAYER -> BLENDING MODE -> NORMAL and this resolved my issue!
    Thanks so much!

  • How to refresh table column during button method call ?

    Hi,
    I have one table on my screen in which there are 5 rows.
    One of the column of this table is Status with initial value Not Completed.
    Now when I press submit button my 5 processes are started in for loop one by one.
    After completion of 1st process, I am updating 1st row status with Completed and vise a versa.
    But change is reflected on table after by method call over means if my submit action take 5 minutes to finish all 5 process than after 5 minutes, I can see all rows with status Completed while I want it to reflect as soon as I set its status.
    How can I do this ?
    regards,
    devang

    .. or break up the method in 5 methods (for each process a separate method) and with you button you call the first method. then when at the end of the method you call a javascript which updates the first column to completed and the js calls the second method (with queue of client event and serverListener) ... and so on and so on.
    Really not so cool idea but I think it's achievable:)

  • 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

  • Flex addEventListener - how to refresh the screen during called event?

    I can't seem to find the answer to what I would have thought was a common problem.
    What I want to do this is:
    1. Show the Open File Dialog
    2. Process the file selected
    3. During processing the file, report progress to the User
    I have a file defined, and am using the browseForOpen and AddEventListener:
        public var fileInput:File = new File();
        fileInput.browseForOpen("Open file",[filter]);
        fileInput.addEventListener(Event.SELECT, onFileSelect);
        // Step 2 - function gets called to process the file
        private function onFileSelect(e:Event):void
            // Step 3 - do some processing, and at intervals report progress to the screen
    My issue is - any changes to the screen within the event listener do not get done until the function is complete.
    Any help would be appreciated,
    Thanks

    Hi Neal,
    I'd suggest breaking up your processing in Step 3 so that the player has a chance to step in and update the screen. Take a look at articles on "green threads" for the basic concept:
    http://blog.generalrelativity.org/?s=green
    http://code.google.com/p/greenthreads/
    Off the top of my head, some ways to break your processing up into chunks:
    set up a Timer that fires every n milliseconds, and a listener on the Timer events that processes a chunk of the file on each event
    set up an ENTER_FRAME event handler that processes a chunk of the file on each event
    chain the processing of your chunks of the file with callLater() calls
    Also, you may want to take a look at the ProgressBar component for reporting the progress of your processing.
    HTH,
    -- Tom Kraikit
    Flex SDK engineer

  • How to refresh to reflect the latest change

    i have one page to create a new record, then i want to go to another display page to see this new record is one of the displayed record set. how to do this? Thanks!

    Hi,
    1. Build the page and create a form
    2. On submit, persist the form data
    3. On the next page display the form data
    Your question does not have more in it
    Frank

  • How to Refresh JTree if a file System got changed during Run-time

    Hi,
    Can anyone tell me how to refresh a JTree(javax.swing.JTree) used for displaying file system(both local and remote).
    I'm getting a problem if a file/directoy is added to the file system, after my Applet is loaded. Actually, i have used DefaultTreeModel's reload() method for refreshing and calling it inside SwingUtilities.invokeLater() using Thread, but its not working.
    I want that the tree should reflect the latest Files/Directories on the click of a node, if any file or directory is added under that node.
    Plz tell me if this is possible or not.
    Thanks

    Hi Shay_te,
    Thanx for ur reply as i was eagerly waiting for the one.
    but the example is using the TreeTable
    and i have used JTree and DefaultTreeModel.
    I'm calling reload(node) within treeExpand() method
    Then, i'm regestring addTreeModelListener() as
    m_model.addTreeModelListener(new javax.swing.event. TreeModelListener(){ }
    inside which all 4 methods are over-ridden
    code snippet is as follows so plz help me and tell if this the right way:
    class DirExpansionListener implements TreeExpansionListener{
            DirExpansionListener(){
            public void treeExpanded(TreeExpansionEvent event) {
                final DefaultMutableTreeNode node = getTreeNode(event.getPath());
                final FileNode fnode = getFileNode(node);
                Thread runner = new Thread() {
                    public void run() {
                        if (fnode != null && fnode.expand(node)) {
                            Runnable runnable = new Runnable() {
                                public void run() {
                                    try{
                                       m_model.reload(node);
                                        m_model.addTreeModelListener(new javax.swing.event.TreeModelListener() {
                                            public void treeNodesChanged(javax.swing.event.TreeModelEvent evt) {
                                            public void treeStructureChanged(javax.swing.event.TreeModelEvent evt) {
                                                System.out.println("Path of node changed->"+evt.getTreePath());
                                            public void treeNodesInserted(javax.swing.event.TreeModelEvent evt) {
                                                System.out.println("Nodes Inserted method called..");
                                            public void treeNodesRemoved(javax.swing.event.TreeModelEvent evt) {
                                        System.out.println("Run inside DEvent called..");
                                        //Thread.sleep(500);
                                        //fnode.expand(node);
                                    }catch(Exception e){System.out.println("err :" +e);}
                            SwingUtilities.invokeLater(runnable);
                runner.start();
            public void treeCollapsed(TreeExpansionEvent event) {}
        Please reply...

  • Partially refresh the sql report region by clicking the region selector tab

    Hi,
    In my page i have a region display selector tab. This region selector tab contain show all,booking,service,.. etc. when i click the booking tab,sql report region will appear. My intention is when i click the booking tab i want to refresh that region partially to display the record according to sql query in that region source of report region.
    how to do this?
    skud.

    KevinFitz wrote:
    The report region being displayed is conditional on P2_QUERY item being NOT NULL. I assume the region not appearing is because the Action for the Select List Item is set to None and so P2_QUERY is always NULL.
    No, the region is not appearing because it is conditional on P2_QUERY being NOT NULL. This means that the report region never exists on the page shown in the browser, so it can't be dynamically refreshed. (Dynamic refresh doesn't evaluate region conditions, and it only re-renders the report content, not the entire region.)
    Remove the condition on the report region, check the refresh is working, then reconsider exactly what the requirements here are. If you want the region to appear only when P2_QUERY has a value, and you want it to be refreshed without submitting and re-rendering the page, then the region needs to be hidden rather than conditionally rendered, and shown via a dynamic action when P2_QUERY gets a value.
    I tried adding an additional Set Value True Action for the DA event but got an error as listed above,
    All irrelevant if Page Items to Submit on the region is used properly.

  • How can we prevent JTabbedPanes from transferring focus to components outside of the tabs during tab traversal?

    Hi,
    I noticed a strange focus traversal behavior of JTabbedPane.
    During tab traversal (when the user's intention is just to switch between tabs), the focus is transferred to a component outside of the tabs (if there is a component after/below the JTabbedPane component), if using Java 6. For example, if using the SSCCE below...
    import java.awt.BorderLayout;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class TabbedPaneTest extends JPanel {
        public TabbedPaneTest() {
            super(new BorderLayout());
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Tab 1", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
            tabbedPane.addTab("Tab 2", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
            tabbedPane.addTab("Tab 3", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
            tabbedPane.addTab("Tab 4", buildPanelWithChildComponents());
            tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(tabbedPane);
            JButton button = new JButton("Dummy component that gains focus when switching tabs");
            panel.add(button, BorderLayout.SOUTH);
             * To replicate the focus traversal issue, please follow these steps -
             * 1) Run this program in Java 6; and then
             * 2) Click on a child component inside any tab; and then
             * 3) Click on any other tab (or use the mnemonic keys ALT + 1 to ALT 4).
            button.addFocusListener(new FocusAdapter() {
                @Override
                public void focusGained(FocusEvent e) {
                    System.err.println("Gained focus (not supposed to when just switching tabs).");
            add(new JScrollPane(panel));
        private JPanel buildPanelWithChildComponents() {
            JPanel panel = new JPanel();
            BoxLayout boxlayout = new BoxLayout(panel, BoxLayout.PAGE_AXIS);
            panel.setLayout(boxlayout);
            panel.add(Box.createVerticalStrut(3));
            for (int i = 0; i < 4; i++) {
                panel.add(new JTextField(10));
                panel.add(Box.createVerticalStrut(3));
            return panel;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test for Java 6");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.add(new TabbedPaneTest());
                    frame.pack();
                    frame.setVisible(true);
    ... Then we can replicate this behavior by following these steps:
    1) Run the program in Java 6; and then
    2) Click on a child component in any of the tabs; and then
    3) Click on any other tab (or use the mnemonic keys 'ALT + 1' to 'ALT + 4').
    At step 3 (upon selecting any other tab), the focus would go to the component below the JTabbedPane first (hence the printed message in the console), before actually going to the selected tab.
    This does not occur in Java 7, so I'm assuming it is a bug that is fixed. And I know that Oracle suggests that we should use Java 7 nowadays.
    The problem is: We need to stick to Java 6 for a certain application. So I'm looking for a way to fix this issue for all our JTabbedPane components while using Java 6.
    So, is there a way to prevent JTabbedPanes from passing the focus to components outside of the tabs during tab traversal (e.g. when users are just switching between tabs), in Java 6?
    Note: I've read the release notes between Java 6u45 to Java 7u15, but I was unable to find any changes related to the JTabbedPane component. So any pointers on this would be deeply appreciated.
    Regards,
    James

    Hi Kleopatra,
    Thanks for the reply.
    Please allow me to clarify first: Actually the problem is not that the child components (inside tabs) get focused before the selected tab. The problem is: the component outside of the tabs gets focused before the selected tab. For example, the JButton in the SSCCE posted above gets focused when users switch between tabs, despite the fact that the JButton is not a child component of the JTabbedPane.
    It is important for me to prevent this behavior because it causes a usability issue for forms with 'auto-scrolling' features.
    What I mean by 'auto-scrolling' here is: a feature where the form automatically scrolls down to show the current focused component (if the component is not already visible). This is a usability improvement for long forms with scroll bars (which saves the users' effort of manually scrolling down just to see the focused component).
    To see this feature in action, please run the SSCCE below, and keep pressing the 'Tab' key (the scroll pane will follow the focused component automatically):
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextField;
    import javax.swing.JViewport;
    import javax.swing.SwingUtilities;
    public class TabbedPaneAutoScrollTest extends JPanel {
        private AutoScrollFocusHandler autoScrollFocusHandler;
        public TabbedPaneAutoScrollTest() {
            super(new BorderLayout());
            autoScrollFocusHandler = new AutoScrollFocusHandler();
            JTabbedPane tabbedPane = new JTabbedPane();
            tabbedPane.addTab("Tab 1", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
            tabbedPane.addTab("Tab 2", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
            tabbedPane.addTab("Tab 3", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
            tabbedPane.addTab("Tab 4", buildPanelWithChildComponents(20));
            tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(tabbedPane);
            JButton button = new JButton("Dummy component that gains focus when switching tabs");
            panel.add(button, BorderLayout.SOUTH);
             * To replicate the focus traversal issue, please follow these steps -
             * 1) Run this program in Java 6; and then
             * 2) Click on a child component inside any tab; and then
             * 3) Click on any other tab (or use the mnemonic keys ALT + 1 to ALT 4).
            button.addFocusListener(new FocusAdapter() {
                @Override
                public void focusGained(FocusEvent e) {
                    System.err.println("Gained focus (not supposed to when just switching tabs).");
            button.addFocusListener(autoScrollFocusHandler);
            JScrollPane scrollPane = new JScrollPane(panel);
            add(scrollPane);
            autoScrollFocusHandler.setScrollPane(scrollPane);
        private JPanel buildPanelWithChildComponents(int numberOfChildComponents) {
            final JPanel panel = new JPanel(new GridBagLayout());
            final String labelPrefix = "Dummy Field ";
            final Insets labelInsets = new Insets(5, 5, 5, 5);
            final Insets textFieldInsets = new Insets(5, 0, 5, 0);
            final GridBagConstraints gridBagConstraints = new GridBagConstraints();
            JTextField textField;
            for (int i = 0; i < numberOfChildComponents; i++) {
                gridBagConstraints.insets = labelInsets;
                gridBagConstraints.gridx = 1;
                gridBagConstraints.gridy = i;
                panel.add(new JLabel(labelPrefix + (i + 1)), gridBagConstraints);
                gridBagConstraints.insets = textFieldInsets;
                gridBagConstraints.gridx = 2;
                textField = new JTextField(22);
                panel.add(textField, gridBagConstraints);
                textField.addFocusListener(autoScrollFocusHandler);
            return panel;
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame frame = new JFrame("Test for Java 6 with auto-scrolling");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.add(new TabbedPaneAutoScrollTest());
                    frame.setSize(400, 300);
                    frame.setVisible(true);
    * Crude but simple example for auto-scrolling to focused components.
    * Note: We don't actually use FocusListeners for this feature,
    *       but this is short enough to demonstrate how it behaves.
    class AutoScrollFocusHandler extends FocusAdapter {
        private JViewport viewport;
        private JComponent view;
        public void setScrollPane(JScrollPane scrollPane) {
            viewport = scrollPane.getViewport();
            view = (JComponent) viewport.getView();
        @Override
        public void focusGained(FocusEvent event) {
            Component component = (Component) event.getSource();
            view.scrollRectToVisible(SwingUtilities.convertRectangle(component.getParent(),
                    component.getBounds(), view));
    Now, while the focus is still within the tab contents, try to switch to any other tab (e.g. by clicking on the tab headers, or by using the mnemonic keys 'ALT + 1' to 'ALT + 4')...
    ... then you'll notice the following usability issue:
    1) JRE 1.6 causes the focus to transfer to the JButton (which is outside of the tabs entirely) first; then
    2) In response to the JButton gaining focus, the 'auto-scrolling' feature scrolls down to the bottom of the form, to show the JButton. At this point, the tab headers are hidden from view since there are many child components; then
    3) JRE 1.6 transfers the focus to the tab contents; then
    4) The 'auto-scrolling' feature scrolls up to the selected tab's contents, but the tab header itself is still hidden from view (as a side effect of the behavior above); then
    5) Users are forced to manually scroll up to see the tab headers whenever they are just switching between tabs.
    In short, the tab headers will be hidden when users switch tabs, due to the Java 6 behavior posted above.
    That is why it is important for me to prevent the behavior in my first post above (so that it won't cause usability issues when we apply the 'auto-scrolling' feature to our forms).
    Best Regards,
    James

  • How to call a macro(check for unsaved data) before calling refresh button of EPM TAB

    Hi,
    I want to show a popup message for any unsaved data before USER hit the refresh button on EPM tab.
    I write the macro like as below in module
    Function TestForUnsavedChanges()
        If ActiveWorkbook.Saved = False Then
            If MsgBox("There is unsaved data, save the data otherwise u will loose the data. Do You Want to Save the Data ?", vbYesNo, "Warning") = vbYes Then
            bSave = True
            Else
            bSave = False
            Application.Undo
            End If
        End If
    End Function
    so how to execute this macro before Refresh ?
    Thanking in Advance !!

    Hi Nilesh,
    Try to add this macro under Function BEFORE_REFRESH.
    Hope this helps.
    Regards,
    Astha

  • How to handle tab change event in UI shell main area

    Hi,
    I have two tabs(two taskflows) in UI shell main area. one is department tab and another is employee tab. My department tab shows employees department wise. On employee tab I have emplyee table which shows employees jobwise. This employee table has the functionality of adding new record to employee vo as well.
    Now i follow these steps.
    1. by defualt department tab is open.
    2. by clickinng on Tasks menu link i open Employee tab in to main area. Now i have both tabs in main area.
    3. at Employee tab I search all employees job = accountant. It shows the search result well.
    4. Now i add a new record to it and without saving/deleting this record i move to department tab.
    5. at Department tab i search employees where department =20, here no relation b/w job and department.
    6. Now i return to employee tab. my newly added record got disappeared. It is there but does not show in table.
    How to resolve it??
    I have one solution in my mind while changing the tab i can prompt to user "you can not leave the newly added record..either save it or delete it". But how to catch tab change event here? where i can write code to prompt msg to user?
    Pls help.
    Edited by: 900997 on May 6, 2012 4:10 AM

    With apologies for the slow reply, I'm currently travelling.
    Two things to note:
    1) The af:document uncommittedDataWarning flag was designed to stop users navigating away from half entered records. More about this flag can be found here:
    http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_orgpage.htm#CACDDDFH (see point 4)
    http://www.oracle.com/technetwork/developer-tools/adf/unsaveddatawarning-096556.html
    ....please note our documentation from time to time spells this flag wrong with only one "t" in the word committed, so if you're attempting a bulk search check for this (and I'll raise document bugs to get this fixed in the future).
    2) On addressing the ADF UI Shell, if you're switching between "pages" in the UI Shell, as separate to switching between dynamic tabs within a single page using the UI Shell, the UI Shell will actually restart the currently running task flow in the page you're returning too. You can verify this by implementing an initializer on your task flow with a log message, and watching when the initializer is called.
    In addressing your last question, at this stage I think you need to assess my first answer then come back if you think you sill need to execute the code on the tab click. I also need to know are you talking about the primary level of tabs that represent each page in the UI Shell, or are you referring to the dynamic tabs within a single UI Shell page that hold your task flows?
    CM.

  • How to refresh selectItems during a command action

    I am trying to figure out how to modify the selectItems during the processing of a command action. The command action modifies the database and the selectItems needs to be refreshed by this command. However, the selectItems is getting populated before the action method is called. Is there any way to explicitly set the selectItems during the command action?
    Here are the pertinant tags on my jsp page:
    <h:selectOneListbox value="#{generateDailyFile.selectedFilename}"
    binding="#{generateDailyFile.fileListSelect}">
    <f:selectItems value="#{generateDailyFile.items}"
    binding="#{generateDailyFile.filesSelectItems}"/>
    </h:selectOneListbox>
    <h:commandButton value="Generate"
    action="#{generateDailyFile.doAction}" />
    When the page first opens it loads the selectItems from the generateDailyFile.getItems() method. However, when the commandButton's action calls generateDailyFile.doAction() I need to refresh the selectItems.

    your selectitems are from the data base i think they have to be latest from the DB......Since they are not working as desired...
    ----what is the scope of the object you are building the selectitems.If it is session previous instant pravails so the items are the same as before.
    OR
    --- in the OnPageLoad() make a call to build the select items that gets you a recent copy.

Maybe you are looking for