How to intercept tab disclosure in javascript

Hello ADFrs,
I am trying to write some ADF  and javascript code that intercepts a tab disclosure event, and pops up a message that says when the tab is dirty, as the user do they wanna save first.
I found this really good document online from Frank N. 
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/104-interceptpaneltabswitching-1880961.pdf
I've implemented this the way that he has listed.  However, I'm getting a weird behavior.  When I click on another tab, I get the popup and my javascript is getting called, but the tab I'm switching to is still getting disclosed.  Based on the document, the tab shouldn't get disclosed after I cancel the discloseEvent in my javascript.
I currently have something like this..
<panelTabbed>
    <showDetailItem ...   >
<clientListener type="disclose" method="handleTabSwitch"/>
    </showDetailItem>
    <showDetailItem ..... >
<clientListener type="disclose" method="handleTabSwitch"/>
</showDetailItem>
</panelTabbed>
in my JS
function handleTabSwitch(disclosedEvent) {
     console.log("firing off handleTabSwitch() ...");
     var tab = disclosedEvent.getSource();
     if(tab.isDisclosed == false) {
         disclosedEvent.cancel();
After adding this code, when I select a new tab, my javascript gets fired, but the new tab is still opening.  I want to set this up so that the other tab never opens. 
Anyone ideas?

... are you sure the provided sample doesn't work? I downloaded the sample and ran it with JDeveloper 11.1.2.3. Testing it on FF 12 and IE 8 worked like a charm. Note that there are two disclosure events in JavaSCript and you want to make sure you listen for the first
Frank

Similar Messages

  • How to create tab pages in EP

    Hi Experts,
    Can you please let me know how to create tab pages in EP. I have created one page. In this page, I have to place 2 iViews as tab pages. Can you please let me know how I can acheive this?
    Regards,

    Stuart,
    Within a SAP Portal Tabs are not used like you want them to
    By default Tabs are used inside an iView and not to "tab" between iViews on a page...
    The most straightforward solution would be creating a custom PageLayout that you can assign to your page.
    I would sugest to implement this custom PageLayout with DIV layers and trigger "tabbing" via JavaScript eventing.
    For more infor on how to create a custom PageLayout take a look at here:
    [http://help.sap.com/saphelp_nw70/helpdata/en/42/efbac120711a71e10000000a422035/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/42/efbac120711a71e10000000a422035/frameset.htm]
    Good Luck,
    Benjamin Houttuin

  • Help. How do you TAB from HTML component to applet (and back) ?

    How can one tab between applets in a browser, and from an applet to an HTML component?
    For example, I have the following in my page in decending order:
    an HTML text field,
    an applet containing two components,
    and another HTML text field.
    When focus is on the first HTML text field pressing TAB should shift focus to the first component of the applet, the next TAB press shifts focus to the second component of the applet, and the next TAB press shifts focus to the other HTML text field. Then another TAB press cycles back to the first TEXT field.
    I can handle the tabbing within the applet using the FocusManager, but how can I get the applet to receive focus on a TAB from the browser, and once the applet has focus, how can I give focus back to the browser when a TAB occurs from my last applet sub-component?
    At the moment a user has to click on the applet before he can tab in it, and then click outside it to tab in the html again.
    Any help appreciated, as I cant find any reference to how to do this apart from other people asking the same but getting no replies.
    Thanks,
    Menno

    I see what you are saying. Either use javascript with LiveConnect or go all applets.
    What we are actually doing at the moment is trying to componentise using small applets passing data via InfoBus. So I guess we could use only applets as you suggest. Either with getAppletContext, or we could have a data item on the InfoBus which contains the name of the required in-focus applet, and all applets listen to see if it is their name, and if so request focus.
    I'm suprised applets are not tab-able between by default. I would have thought this was a common requirement.
    I'll look into LiveConnect as well, and let you know how we get on.
    Cheers,
    Menno

  • How to create tab pages in Human task Using Wizard

    hi,
    how to create tab pages in Human task Using Wizard.i need to display the personal details and the offical details in the same page with different tabs for each.it is possible to do lika this.if yes,how can we do this.
    Regards

    Stuart,
    Within a SAP Portal Tabs are not used like you want them to
    By default Tabs are used inside an iView and not to "tab" between iViews on a page...
    The most straightforward solution would be creating a custom PageLayout that you can assign to your page.
    I would sugest to implement this custom PageLayout with DIV layers and trigger "tabbing" via JavaScript eventing.
    For more infor on how to create a custom PageLayout take a look at here:
    [http://help.sap.com/saphelp_nw70/helpdata/en/42/efbac120711a71e10000000a422035/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/42/efbac120711a71e10000000a422035/frameset.htm]
    Good Luck,
    Benjamin Houttuin

  • How to intercept the Adobe Flash plugin block by firefox checking for vulnerabilities?

    The trouble is the grey block, that asking to update Adobe Flash because the version is vulnerability. If the block of Flash object is smaller, then 100px height - there is an empty space, but not gray block with talking about version. I need to intercept the moment using JavaScript, when Firefox checking the version of plugin to make changes in my HTML code to make a GIF, but not flash.
    How to intercept the Adobe Flash plugin block by Firefox checking for vulnerabilities from JavaScript code?

    hello, i don't think that this would be possible (but i'm not sure). what you could do is try to sniff the version of flash that is installed & the firefox useragent and just assume that old versions of the plugin will be blocked in this combination.
    if you need more help about that, i'd recommend posting in a forum that is more specialized & knowledgeable in web development like http://forums.mozillazine.org/viewforum.php?f=25, since we here on the firefox support forums are primarily focused on support for end-users...

  • The correct approach to intercept TAB key

    Dear Experts,
    I have developed a GUI out of javax.swing. The GUI consists of JFrame, several JPanels and javax components, such as JTextField, JLabel, JComboBox, JTable and many more.
    Now, I want to change the behavior when user presses TAB key. By default TAB key moves focus from a component to another component. How can I disable this?
    I come to two alternatives that I am not sure which one is the correct approach. Could you please advise me?
    Alternative 1.
    Use key binding on GlassPane.
    Alternative 2.
    Use event-handling on GlassPane.
    If those alternatives are not the best one, could you please provide another alternative?
    I have tried the following, but they didn't work...
    Action doNothing = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            System.out.println("Tab-key is pressed.");
    cmbPCode.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "doNothing");
    cmbPCode.getActionMap().put("doNothing", doNothing);or
    getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "doNothing");
    getRootPane().getActionMap().put("doNothing", doNothing);where cmbPCode is a JComboBox that receives focus when the GUI shows up.
    Thanks for your help,
    Patrick
    Edited by: Patrick_Stiady on Mar 31, 2009 6:51 AM

    Thank you for the advice. I am developing an application where the user is not computer literated, so that I have to limit functional key as many as possible and only allow several keys to be active. For example, I don't want TAB key to change the focus, instead I want TAB key to do nothing.
    I have tried keybinding, because I think this is the most relevant, but somehow I failed to recognize which component should be bound with keybinding. I have tried to change the input map of the component that receives the focus when the GUI is displayed (cmbPCode) as can be seen on my first post. I also tried to change the input map of the root pane. Both are not successful.
    Now, I wonder whether
    1. it does not work because the key is not consume()?
    2. Or should I use key listener, which I would only use if keybinding were unable to serve my goal?
    3. Or should I learn how to intercept key on the glass pane?
    4. Is keybinding able to nullify default action, such as changing focus by TAB key? I am asking this, because I'm going to nullify other important key such as ENTER key.
    Thank you for any guidance,
    Patrick

  • How to setup tab in a pdf form

    can someone explain how to set tabs in a writeable pdf form

    If you're asking about setting tab stops for a text field, there is not a means to do this. Though you can insert a tab character into a field value programmatically, I've never found a way to do it from the keyboard.

  • How to cancel tabbed viewing in Fireworks CS5?

    How to cancel tabbed viewing in Fireworks CS5? I don't like tabs, but I couldn't find in Preferences an option to cancel it.

    Choose Window > Cascade from the main toolbar.

  • Acrobat X Pro.  How to get tab to show up in Microsoft Office ribbon?

    Acrobat X Pro.  How to get tab to show up in Microsoft Office ribbon?

    Hi ebender888,
    Which Office version are you using?
    If it's Office 2013 then Acrobat 10 pdfmaker is not compatible.
    Please refer: http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html#main_ PDFMaker_compatible_applications
    Regards,
    Rave

  • How to include custom taglib in javascript on a given jsp page

    Hi,
    How to include custom taglib in javascript on a given jsp page?
    i have a jsp page on which i am adding selectboxes using javascript.
    But now i have created my own custom select box and want to add it on a given jsp page.
    is the code to create the box box.
    <sample:pickListOptions employeeId="abcs123"/>
    but how should i embed it in javascript, so that i will be able to add it on the give jsp page.
    Thanks,
    Javaqueue

    when the jsp page is loaded for the first time it contains a select box containg names created by a taglib.but there is a feature i want to add wherein though javascript the name selectebox will keep on coming on each row i want to add. and this is row addition and deletion is being handled by the javascript. there i encounter the bug how to interact the javascript with taglib so tha with each row addition i will have populated taglib created select box on each row.
    Thanks,
    Javaqueue

  • How to intercept the InCopy 'Save' button action?

    Hi,
    I have an InCopy plug-in that can successfully intercept ‘Save’ actions from the File->Save menu (using an Action Filter).
    But in InCopy there is also a Command Bar that contains a ‘Save’ button. The problem is that I cannot work out how to intercept this button action from within the plug-in code.
    I have tried ‘Spy’ and tracing events and so far there does not appear to be any clue to what I should be intercepting to achieve this.
    (the button action does not appear to trigger a FileSave action... which is what I was hoping it would do).

    Thanks for the reply, I am beginning to think that I need to do something similar.
    Did you disable the button via code?
    I know that the class id (boss) for this button is kSaveButtonBoss.
    Regards
    Malcolm

  • How we do set resolutions in javascript to develope a game in unity 3d

    how we do set resolutions in javascript to develope a game in unity 3d

    If you're not talking about JS in PDF files, this is the wrong forum for
    your question.

  • How to intercept style changes in skin for spark Button?

    How to intercept style changes in skin for spark Button?
    Thank you.

    How to intercept style changes in skin for spark Button?
    Thank you.

  • How to call java function in javascript

    Hello Everyone,
    Can anyone tell me solution that:
    How to call java function in javascript?
    Thanks,
    VIDs

    You can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
    But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want.

  • How do you tab out of JTextArea?

    When using the tab key to change focus from one
    JComponet to the next, how do you tab out of, and
    into next JComponent when you're in an editable
    JTextArea? Is it possible?

    Move to the bottom of the text in a JTextArea with VK_CONTROL + VK_END.
    Better yet, here is how to find all the input actions that you can trigger when focus is on a JTextArea (or any given JComponent)
    JTextArea text = new JTextArea();
    InputMap im = text.getInputMap();
    KeyStroke[] ks = im.allKeys();
    SortedMap map = new TreeMap();
    for(int i=0; i<ks.length; ++i)
        map.put(im.get(ks), ks[i]);
    for(Iterator i = map.entrySet().iterator(); i.hasNext() ; ) {
    Map.Entry pair = (Map.Entry) i.next();
    System.out.println(pair.getKey() + "\n\t" + pair.getValue());

Maybe you are looking for

  • Floating Footer ; help me stick the little guy to the bottom Once and For all

    Hey there have floating footer in browsers : I have tried couple of things but not yet got it to stick here is the website www.huntfilms.ie and here is the code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm

  • ITune can't open!!!!!!!!

    Hi everyone, I'm having some problems with itune working on my window XP system. I have the latest verison for itune but I'm unable to open the program. Everytime I try to open it I get This message "iTune Has encountered a problem and needs to close

  • Linux J2SE 1.5.0 install w/o graphical interface

    Here's a special situation from the geniuses at Sun. 1. Bundle NetBeans for the J2SE. Never mind that people may want a 'server' installation. 2. So, I try to run it with the installer with the -console option on Linux (Fedora Core 4): $ ./jdk-1_5_0_

  • Using Videora

    I'm pasting this from the Videora site, the settings worked for me when others didn't, enjoy: Configuring videora converter 0) Start Videora iPod converter. 1) Click setup in the left nav. 1.5) Click the profiles tab. 2) Click new profile. 3) Now, co

  • Speech Recognition Control for commercial use

    I would like to use Speech Recognition Control for commercial use. Is it possible?