Close current tab through a button

All,
I have a weird behavior in my ADF page.
I have a method to close the current tab.
When i set this method as Action Listener for a commandMenuItem , its working fine.
But when i set this method as Action listener for a button , its throwing nullPointerException.
I am pasting below a part of the stack trace.
Can anybody please help me on this ?
<RegistrationConfigurator><handleError> Server Exception during PPR, #1
javax.servlet.ServletException
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:421)
     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:421)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:160)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

John,
Here is my code to close the tab.
public void closeCurrentActivity(ActionEvent actionEvent) {
TabContext tabContext = TabContext.getCurrentInstance();
int tabIndex = tabContext.getSelectedTabIndex();
if (tabIndex != -1) {
tabContext.removeTab(tabIndex);
Am getting nullPointerException at
int tabIndex = tabContext.getSelectedTabIndex();
Thanks
Edited by: Kani on Jun 23, 2010 12:01 AM

Similar Messages

  • Close current swf after a button clicked to call for another swf

    daftar_isi.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_2);
    import fl.display.ProLoader;
    var fl_ProLoader_2:ProLoader;
    var fl_ToLoad_2:Boolean = true;
    function fl_ClickToLoadUnloadSWF_2(event:MouseEvent):void
      if(fl_ToLoad_2)
      fl_ProLoader_2 = new ProLoader();
      fl_ProLoader_2.load(new URLRequest("daftarisi_c.swf"));
      addChild(fl_ProLoader_2);
      else
      fl_ProLoader_2.unload();
      removeChild(fl_ProLoader_2);
      fl_ProLoader_2 = null;
      fl_ToLoad_2 = !fl_ToLoad_2;
    What script should i add to kill this current swf after i clicked on "daftar_isi" button which will play daftarisi_c.swf?
    thanks.

    Thx ned. The new swf is added above the first swf. I need to kill the first swf when i click on the "daftar_isi" button inside first swf after it call out the new swf.
    So the button have 2 function at the same time when clicked:
    1. Call out the new swf
    2. Kill the current swf itself

  • Select current line through push button in module pool

    Hi,
    I have created one module pool program with table control. There I have inserted on push button where some logic is deployed.
    Logic :-
    If I push button on current line or any line, that line should be selected in the program. So that I can move that line to next internal table.
    But, it always shows first line.
    Please suggest the same.

    hi amol,
    GET CURSOR only works on the number of table control lines that can be displayed on screen at any one time.  So, if your screen can display only 4 lines, all you'll ever get from GET CURSOR is a number 1 to 4.  
    But your screen also knows which of your table control records is currently displayed as the top line of your table control.  This information is held in field TC_ITEMS-TOP_LINE (where TC_ITEMS is the name of your table control).  By combining these two bits of information, you can find the correct line number of your selected record. 
    For example in the case you describe where you are clicking on line 5 but GET CURSOR thinks it is line 4 because your screen has moved down a record, I would think that TC_ITEMS-TOP_LINE would be 2.  Add 4 and 2 together, subtract 1 and you'll get your correct line number.
    hope it helps,
    vikas

  • Need help: Tab through DataGrid

    I have developed an application in which, I m able to tab through the buttons,textboxes, drop down and the AdvancedDataGrid on the page. But I m unable to tab through the buttons and checkboxes inside the AdvancedDataGrid, which are rendered through itemRenderer. Please let me know whether is it possible or not.
    If yes,please provide me with a solution.

    It should just work if the renderers are buttons and checkboxes.  If you've wrapped them in containers you'll need to have the containers implement IFocusManagerComponent and delegate focus to the buttons.

  • Tab through the Close File dialogue window buttons?

    In the past when closing a document or file (any app) I could Tab through the different 'Don't Save', 'Cancel' & 'Save' buttons on the close file dialogue window. And also hit the spacebar to select the highlighted button.
    But not any more. It could have stopped working when I deleted items (cleaned up?) from my home Library folder, or maybe it happened after the 10.4.10 update?
    Does anyone else have the same problem? (Can you Tab through them & hit the spacebar to select the highlighted button?) Does anyone know how to fix it?

    Select "All controls" at the bottom of the "Keyboard Shortcuts" pane of "Keyboard & Mouse" System Preference. Control-F7 will also turn it on or off.

  • In FF 3, Intellimouse ("5" buttons) back button closes only the current tab. In FF4 it closes the window. I prefer the former. How can I get FF4 to do that?

    MS's Intellimouse has five "buttons" including the scroll wheel. I set left and right buttons to L-click & R-click (seems normal). I set left side button to Back and right side button to Close.
    In FF3, Close closes the current tab and Ctrl-W closes the window. In FF4, this is reversed -- Close closes the window and all its tabs and Ctrl-W closes the current tab -- not my preferred behavior.
    The behavior switch in FF4 may or may not have been a function of what somebody had for breakfast. It is was, then I'd like it switched back. If there was an important reason for the switch, I'd like to know.
    Until FF4 reverts to FF3 behavior, I'm probably stuck in FF3.
    In anyhow, thanks -- John Linford, Fort Worth

    Harley, thank you so much. I'll reload FF4 and re-set the settings.
    John

  • How can I set firefox to stack my tabs one after the other so that I do not have to move through tabs using the buttons at the ends

    when I open multiple tabs which do not fit the tab strip I have to move through tabs using scroll buttons. is there any way way I can stack the tabs on each other or suggest me a add-on which can help me achieve this

    You can consider to access the tabs via the list all tabs button.
    You see the "List All Tabs" button in current Firefox versions if there are that many tabs open that you get the Tab bar scroll buttons appearing.
    * Permanent List-all-tabs Button: https://addons.mozilla.org/firefox/addon/permanent-listalltabs/
    The Custom Tab Width extension adds CSS rules to adjust the tab width settings as set by the browser.tabs.tabMinWidth and browser.tabs.tabMaxWidth prefs on the <b>about:config</b> page.
    * Custom Tab Width: https://addons.mozilla.org/firefox/addon/custom-tab-width/
    You can achieve the same with code in userChrome.css.
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #tabbrowser-tabs ~ #alltabs-button { visibility:visible!important; }
    .tabbrowser-tab[fadein]:not([pinned]) { min-width: 100px !important; max-width: 250px !important; }
    </nowiki></pre>

  • How can I close the current tab in Firefox v 17.0.1?

    I have used Firefox for years and have always used Tabs instead of opening new windows. I have always been able to click the little "X" on the right side of the tab to close it. I am finding now that I cannot close the current tab by doing this. I have to click on another open tab and then click on the other tab I wanted to close.
    I have looked through the Options many times trying to see if there is a setting I need to change, but have not found anything.
    Is it possible in this version of Firefox (v17.0.1) to close the current tab?

    I started Firefox in SAFE MODE and the problem went away. I checked for updates and all were up to date. I then restarted Firefox and it worked fine. Since I didn't really do anything, I am curious as to why it is now working as expected. I am glad, but still curious.
    Thank you.

  • Where can i find the option of, when i close firefox that he saves my current tabs and when i open my firefox i will still have them?

    Where can i find the option of, when i close firefox that he saves my current tabs and when i open my firefox i will still have them?

    Firefox 4 and later versions save the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    Use "File > Exit" or "Firefox > Exit" (Mac: "Firefox > Quit Firefox") if you want to restore multiple windows or otherwise have problems with restoring tabs.<br />
    You can use "History > Restore Previous Session" to get the previous session at any time.<br />
    You may need to click the orange/gray Firefox button to see History.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.
    Using the "Show my windows and tabs from last time" setting is a more reliable way to restore session data.
    * Tools > Options > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"
    * http://kb.mozillazine.org/Menu_differences
    Make sure that you do not use "Clear Recent History" to clear the 'Browsing History' when you close Firefox.
    * https://support.mozilla.org/kb/Clear+Recent+History

  • Since upgrading to 4.0 and now 5.0 tabs do not have tab close buttons and I must use CNTL-W to close open tabs, what's the problem?

    Since upgrading to Firefox 4.0 the close tab button, usually in the upper right corner of the tab has been missing. I have just recently upgraded automatically to 5.0 and the tab close 'X' button is still missing from all open tabs. The only way to close a tab is to click on it and use CNTL-W to close out the tab.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Is there any way to close just the "current tab" in firefox rather than all 3 or 4 that may be open and lose the entire web page?

    If I am on a website and open a few different pages, and then decide to go back to an earlier page, or close that particular page, I get a message that says you are about to close 3 tabs or 4 tabs etc. If I only want to close the "current tab" I am on, I was able to do that with Internet Explorer. Is there any way this can be done on Firefox?

    For more help, see the '''[[Tabbed browsing]]''' page.

  • Mailto links open google (desired) but load in current tab, moving away from website, and cannot hit "back" button to return.

    I have firefox set to open "mailto" links, which is desired. However, when clicking the link, the gmail compose window opens in the current tab/window, and therefore leaves the website. Most of the time, the "back" button is not active, so I cannot get back to the website. The back button issue does not happen 100% for some reason.
    To further explain, this is a website I am creating, so I am not sure if the fault lies with my code or in the google mailto option in firefox. (Code shown below)
    >>>>>
    <a class="email" href="mailto:[email protected]">email: [email protected]</a>
    >>>>>
    I tried using a target in the mailto link, but they seem not to work with mailto links like they do for links to other webpages. (Code shown below)
    >>>>>
    <a class="email" href="mailto:[email protected]" target="_blank">email: [email protected]</a>
    ---or---
    <a class="email" href="mailto:[email protected]" target="_new">email: [email protected]</a>
    >>>>>
    Any pointers will help. Is my code bad? Or if the problem is with firefox's way of handling mailto links, is there a way to code to get around this?

    I don't wanna claim total credit for it. I remember seeing someone mentioned a Back button problem with McAfee Add-on in the forum. I dismissed it initially because it seems far-fetched...

  • Why, suddenly can't I create a new tab through the "file' drop down or by using the "add a tab" button.

    The only way I can create a new tab right now is to right click on a link in the current tab and ask it to "open in new tab".

    This problem in is Firefox on your Mac?
    May users have discovered this problem is caused by Conduit add-ons, such as a Conduit plugin and/or a "Community Toolbar" extension.
    You can check for and disable extensions on the Add-ons page. Either:
    * Command+Shift+a
    * "3-bar" menu button (or Tools menu) > Add-ons
    In the left column, click Extensions. Then, if in doubt, disable.
    Often a link will appear above at least one disabled extension to restart Firefox. You can complete your work on the tab and click one of the links as the last step.
    Does that help with the "+" button? If so, could you name the specific extension that caused the problem?
    You might also check the Plugins section of the Add-ons page. You can use "Never Activate" to disable plugins that you don't ordinarily use.

  • I want a stop button for disabling JavaScript only in the current tab

    I want a 'Stop' button for disabling JavaScript only in the current tab.
    I searched for a feature like this but couldn't find it. It would be a great new feature.

    Tab Permissions: https://addons.mozilla.org/firefox/addon/4757

  • Bookmark Toolbar buttons open new tabs - how do I get them to open bookmark in current tab?

    I've got the bookmark toolbar with buttons for all my bookmark links. However, when I click on one, it opens the page in a new tab. I would like those bookmark buttons to open in the current tab.

    Right-click on the bookmark button. Depending on any add-ins you have, the context menu may offer you a range of options e.g. Open (in existing tab), Open in New Tab, Open in New window, etc
    Try the Tab Mix Plus add-in.

Maybe you are looking for

  • Access XMP Metadata outside of Acrobat

    Is it possible to access the PDF metadata without using the full version of Acrobat?

  • Enhancement for a User Exit

    Hi Experts. Can anyone tell me how to know the enhancement for a particular user-exit. Rgds, Simran

  • Is it possible to create a variable that tells you which slides the user has visited?

    Hi there. I'm working on a project where I want a slide to show a continue button and hide 2 textboxes, but ONLY when the user has already visited 2 other slides. I can only find variables that tell you the slide the user previously visited. Is it po

  • Testing WMI for TPM chip

    Win 7 Ts with a group to pre-provision Bitlocker (SCCM 2012 SP1) The group has a condition to run only if "select * from win32_TPM where IsEnabled Initialvalue="False" This works fine on HP laptops but testing a Dell Latitude it skips past Check wbem

  • Palm IIIc won't start up

    I have an older Palm IIIc that has worked beautifully for many years. The battery still holds a charge. Then suddenly I press the power button and it will not boot up.  I have recharged the battery and checked connections. Finally tried a reset but s