Detect if tab is in focus or similar?

Hi guys,
My app is structured so that main.mxml has a tab navigator
which uses moduleloader to load modules to the relevant canvas's.
main.mxml preloads the modules using
ModuleManager.getModule("mymodule.swf").load();
The user then selects module 1 tab, enters data into a dg and
submits this data to a mysql server with a buttonclick.
Module 2 on creationcomplete runs a function which gets the
ID from the database that the user has just submitted in module1
and returns the related data.
However when the user clicks module two the wrong data is
selected. If I refresh the browser the correct data is displayed.
I need something that detects that the module has gained
focus and then runs the function.
Any ideas?

Many ways to do this but I actually suggest a different path
then trying to concern yourself with the FocusManager.
You say it submits to a MySQL server. Are you using a
Middleware server or submitting directly to a local server.
If you are making webservice or remoteObject calls then you
can send the ID back in the return and have that trigger another
call to get the data and place it into your dataProvider. Or even
better might just want to have it send that record back along with
the id.
If you are not using any type of Middleware I would suggest
you do. Otherwise you may just want to write a stored procedure
into the MySQL Database so that when the submission happens it
inserts it and then automatically performs a select on that record
and sends the query back.
This way the same script that submits the form can be waiting
for the returned data to inject into a dataProvider that your
second Module is ready to use.
The dataProvider could simply be a valueObject or you could
use the command pattern to pass data back and fourth.

Similar Messages

  • Detecting the TAB key

    With a recent release of Java, a KeyListener no longer detects the TAB key, which is now apparently considered to be a focus event, not a keyboard event. It is critical to our application, a terminal emulator, that we be able to detect TAB and SHIFT-TAB. I read somewhere about a work-around involving a FocusListener, but a FocusListener does not report when the TAB key is pressed. Can somebody help me here?

    I seem to have solved the problem, and I'd like to present my solution in case anybody else runs across the problem.
    We use an AWTEventlistener. This is intended to watch AWT events but not handle them. However, there is no reason why we shouldn't process tab events within it. AWT will continue to process the tab key as a focus switch, but this solution enabled us to get our applet working again. I hope that future releases of Java will pay more attention to backward compatibility however, so that this kind of fix is not needed.
    In the canvas class:
    // Add the event listener provided we are on a version of the VM
    // that supports it.
    try {
    if (Class.forName("java.awt.event.AWTEventListener")!= null) {
         Toolkit.getDefaultToolkit().addAWTEventListener(new Myeventlistener(), AWTEvent.KEY_EVENT_MASK);
    } catch (Throwable e) {}
    import java.awt.*;
    import java.awt.event.*;
    public class Myeventlistener implements AWTEventListener
    public void eventDispatched(AWTEvent e)
    KeyEvent k = (KeyEvent) e;
    if (k.getID() == k.KEY_PRESSED) {
    if (k.getKeyCode() == 9) {
    if (k.isShiftDown())
    // Process as BackTab Key
    else
    // Process as tab Key

  • Search bar opens in new tab but without focus

    I have Firefox operating on 2 computers. On one when I use the search bar the results are in a new tab and that tab gets the active focus. On the other the search bar results are in a new tab, but that tab does not get the active focus. Both computers used to give the search results in a new tab with active focus. What can I do to give the other one active focus on search results?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Problem with new firefox tabs and window focus

    Here's a problem that I've had for ages - sometimes it annoys me, other times I can live with it. Right now it's really p***ing me off.  :x
    I have selected 'a new tab in the most recent window' under FF's Preferences->Tabs->Open links from other applications in:, so as an example, if I click on a URL in a mail in Thunderbird, Firefox opens it in a new tab. However, window focus stays on Thunderbird. I run both of them full screen, so although I'm looking at the web page in Firefox, anything I do on the keyboards affects Thunderbird. It affects URLs opened from other apps too e.g. if I open a terminal and do
    firefox www.archlinux.org
    focus stays on the terminal window. The only exception is when firefox is not already running - in that case, firefox launches with focus.
    DE is xfce4, and the system is completely up to date.
    I've done some googling, and AFAICS, nobody else seems to have this problem. Any ideas, anyone?
    TIA.

    Thanks MAC!EK - definitely a useful add-on, but it still doesn't solve my problem. In Tab Mix Plus Options, I have the following selected:
    Links -> Open links from other applications in: New tab
    Events-> Tab Focus -> Focus/Select tabs  that open from: <all>
    However, the behaviour is as before i.e. I click a URL in Thunderbird, it opens in a new tab in Firefox, but window focus stays on Thunderbird. Within Firefox, the newly-opened tab is selected or focussed, but Firefox itself is not.
    Anyway, thanks again. I think I need to keep looking.

  • Issue: LOV tabbing out loses focus

    Hi all,
    I've realised that typing some characters in a LOV field and tabbing out results in the following:
    1. The LOV popup window opens, then you select a value and the value is returned to the lov field.
    2. At this moment, the focus is LOST. I would expect the focus to be again at the lov field.
    This doesn't reproduce if you open the LOV with the LOV icon. In this case, the focus returns to the lov field, as expected.
    Is this a bug?
    Does anybody know how to solve it?
    Thanks in advance
    Version
    ADF Business Components 11.1.1.56.60
    Java(TM) Platform 1.6.0_18
    Oracle IDE 11.1.1.3.37.56.60

    Hi a.gruev,
    Thanks for your reply. I did some investigation and found that this has to do with IE8 only:
    Firefox 3.6: you enter some chars, the LOV opens, you select the value and finally, the mouse cursor stays at the end of the lov field value. OK.
    Chrome 7.0: exactly the same, but now the lov field value gets selected and then, the focus remains at the lov field. OK.
    Internet Explorer 8.0: works if I enter part of the value (which launches the LOV); if I enter the exact match, the focus is LOST. KO.
    Unfortunately we can't get rid of IE, so any suggestions for fixing this for IE will be appreciated.
    Barbara
    Edited: Anybody knows whether this is a bug?
    Edited by: Barbara Gelabert on 19-nov-2010 9:09
    Edited by: Barbara Gelabert on 22-nov-2010 6:39

  • When typing in a website after opening in a tab, the cursor focuses to the address bar and makes logging to things difficult, how do I change this?

    As stated in the question on any website I open regardless of whether it is a new tab or just a new destination, the cursor focuses on the address bar and makes logging in to sites very infuriating. Any help is much appreciated.

    Thanks for the help, it didn't help with this particular problem. I figured it out though, I had an issue with the AVG safe search. I had to just delete the file in the program files x86.

  • Tab not changing focus in a JTextArea

    Hi
    I am writing a little program that at a certain point uses a JTextArea. What bugs me a lot is that the JTextArea keeps focus when I press the Tab button
    I see two solutions to this.
    Either I extend JTextArea into MyJTextArea and override the processKeyEvent method and from there address the processKeyEvent method from JTextComponent class
    so the processKeyEvent method from JTextArea never gets a chance at catching the tab.
    The second solution would be to once again extend the JTextArea class and override the processKeyEvent method, and in the method check whether tab was pressed, and in that case change the focus myself
    I don't know if the first is possible, but the second should work. I'm actually rather curious about the first one. So if anyone can help me out in either addressing the super-superclass of MyJTextArea or in changing the focus manually without creating too much of a fuss, I'd be very, very thankfull
    Thx in advance!
    Pieter

    the previous post it's rigth, you can leave the JTextArea using ctrl+tab, but if you really need pass the focus out of the JTextArea with only press tab you can do something like this     myTextArea.setDocument(new PlainDocument() {
              public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
                  if (str.equalsIgnoreCase("\t"))
                        FocusManager.getCurrentManager().focusNextComponent(myTextArea);
                   else
                        super.insertString(offs, str, a);
         }); hope this helps
    lalo s.

  • Tab not getting focus on left-click after suspend in Windows 7 64-bit.

    When I left-click on a tab in Firefox 4 rc 2 after my pc wakes up from suspend in Windows 7 64-bit the tab is not getting focus. I have to use the hotkeys in order to move to that tab. My mouse works fine in other programs.

    I have an imac
    I have an magic pad (same thing as the touch pad on a macbook really)
    I have an usb mouse I use both in windows and osx
    if your trackpad somehow was registered as actived for some reason it would seem as if it was the mouse
    had some *** situations both in windows and osx when my cat sit on the magicpad

  • SPRY Tabbed Panels on focus/URL

    Can you land on a page and control which tab has focus? If I want to link to content on a tab, or cross-reference between two tabs, how could you construct a url...
    Thanks,
    Shearak

    You can also use Spry for this. Have a look here http://labs.adobe.com/technologies/spry/samples/utils/URLUtilsSample.html
    There are a lot of discussions on this topic within this forum. Use the 'search forum' feature to obtain more info.
    And have a look here http://foundationphp.com/tutorials/spry_url_utils.php
    I hope this helps.
    Ben

  • Grabbing focus still needs 2 TABS to show focus border

    I have a JFrame that contains a JSplitPane (jsp1). The left side of jsp1 has a JScrollPane that contains a JTreeTable. The right side of jsp1 contains another JSplitPane (jsp2). The top of jsp2 has a JPanel that contains lots of JTextFields. The bottom of jsp2 has a JPanel that contains a JTabbedPane. Each tab of the JTabbedPane contains a JTable.
    TAB works to navigate through this entire mess. I want to create shortcut keys to jump from anywhere on the screen to the first cell of the JTreeTable. I would also like to be able to jump to the first cell of the JTable that is in the current selected JTabbedPane.
    I have a CTRL-TAB shortcut that moves the focus into the component of the JSplitPane that I want [via requestFocus()], but it takes 2 more presses of the TAB key for the focus border to show up and then when it shows up it is on the 2nd cell of the JTreeTable (or 2nd cell of the JTable inside the JTabbedPane.
    I would like to force the focus without the extra TABS. Any ideas ?
    WW

    Sorry, I don't understand what you are trying to accomplish. However one line did catch my eye.
    This is happening because the popup is not keyboard-focusable The code in the popupPopup() method in the following post might help:
    http://forum.java.sun.com/thread.jspa?threadID=636842

  • Sub Tab is loosing focus

    Hi All,
    I have a Sub Tab Layout with 5 tabs in it. Each sub tab has an advanced search region.
    The page loads correctly with focus on the first tab. I am facing a problem after switching between tabs and any event (Go / Add) is fired on the page. If the Go or Add button of the Advanced search region is clicked, The tab with the greatest index that was accessed is displayed to the user with the First tab being highlighted.
    Eg:
    If when the page loads i switch between the first three tabs of the five without triggering any event(just switching between the tabs) an I get back to the first tab and run a search or add a new search criteria, The tab displayed to the user is the 3rd one with the first tab being highlighted.
    Not sure what is goin on or why this is happening. went through some threads and have implemented the following code in the process request..
    OASubTabLayoutBean subTab =
    (OASubTabLayoutBean)webBean.findChildRecursive("MainRN");
    subTab.setSelectedIndex(pageContext,"CustomSnltyHdrRN");
    OALinkBean link = (OALinkBean)subTab.findChildRecursive("LinkCustomSeas");
    link.setSelected(true);
    "CustomSnltyHdrRN" is my first tab region ID &
    "LinkCustomSeas" is the link ID for the first Tab.
    How can I resolve this? .. Kindly help ..
    Thanks and Regards,
    Dean

    Many ways to do this but I actually suggest a different path
    then trying to concern yourself with the FocusManager.
    You say it submits to a MySQL server. Are you using a
    Middleware server or submitting directly to a local server.
    If you are making webservice or remoteObject calls then you
    can send the ID back in the return and have that trigger another
    call to get the data and place it into your dataProvider. Or even
    better might just want to have it send that record back along with
    the id.
    If you are not using any type of Middleware I would suggest
    you do. Otherwise you may just want to write a stored procedure
    into the MySQL Database so that when the submission happens it
    inserts it and then automatically performs a select on that record
    and sends the query back.
    This way the same script that submits the form can be waiting
    for the returned data to inject into a dataProvider that your
    second Module is ready to use.
    The dataProvider could simply be a valueObject or you could
    use the command pattern to pass data back and fourth.

  • How does one detect flash movie (embed object) focus?

    If I use javascript to shift focus to the embedded flash
    movie object, for example with the following line of code:
    document.getElementById("myMovie").focus();
    Is there any location within actionscript that I can add an
    event listener to detect this shift in focus to the flash movie? I
    have tried attaching a "focusIn" event handler to the application
    container, to the the stage, and the systemManager, but none of
    them appear to work.
    Essentially I need to know what object within the application
    is receiving focus when I make this javascript call.

    Here's a tutorial for adding a referenced movie along with  instructions: #18 - Adding Movie/Video File to iWeb Page via Export for Web in Quicktime Player. 
    OT

  • How to detect if applet lost its focus

    is there a possible way to detect if the applet( the browser itself) lost its focus?
    ANYONE??????????

    it doesnt work for me because i am not using a frame. the applet is embedded in the browser itself.
    You're right. i need to use JSObject to call javascript from java. But i'm still having some problems.
    win = JSObject.getWindow(this);
    str = (String)applet.win.call("myEval", obj);     
    the str should return a 'false' if the applet is out of focus and 'true' if the applet is in focus.
    This is my javascript:
    <script type = "text/javascript">
    var winstate = 'true';
    function myEval() {
         window.onblur = returnFalse();
         return winstate;
    function returnFalse(){
         winstate = 'false';     
    function returnTrue(){
         winstate = 'true';
    </script>
    you know what happens? it always returns 'false' even though the applet is in focus! i don't understand what am i doing wrong. Please help. I am stuck on this.

  • How can I create tabbed panels using Dreamwaever CC, similar to Spry version available in CS6?

    I used Spry tabbed panels in a site. Need to recreate that page on another site using Dreamweaver CC. CC has no Spry components anymore. Can anyone suggest a 3rd party product or alternative method to make similar panels in a page without having to hand code html-css-java?

    Haven’t begun to try it yet. Looking at some tutorials.
    But I appreciate the heads up.
    Bill Liedlich
    TerraGroup Corporation
    Tactical Water Purification Systems
    Po Box 8839
    Allentown, PA 18105 USA
    p  610-821-7003
    f   610-821-7025
    [email protected]
    [email protected]<mailto:[email protected]>
    www.tacticalwater.com<http://www.tacticalwater.com/>
    CONFIDENTIALITY NOTICE: This electronic mail transmission, its contents and any attachments to it, are privileged and confidential, and/or may contain legally privileged and confidential information and is intended only for the review of the party or parties to whom it is addressed.  Any dissemination, distribution, copying or forwarding of this message, its contents or attachments to other than the intended recipient(s) is strictly prohibited.  If you are not one of the intended recipients, or have received this transmission and its contents in error, please immediately return it to the sender.  Unintended transmission shall not constitute a waiver of any "Confidentiality Notice" privilege.

  • How do I detect which process is stealing focus?

    Every 5 minutes at :4 and :9, some process steals keyboard focus, and then gives it back to the application in the foreground.  This disrupts my work because it takes my cursor out of the text box I was typing in, and puts it in the browser generally, and I must re-click in the text box to get focus back.   It's maddening.
    If I reboot my computer, it stops doing that for awhile, until I do some sort of activity which lights off this thing, but I don't know what it is. 
    How can I use diagnostic tools to see which application is doing this?  I have access to "dtrace"  but not quite sure how to ask it for focus changes.  Are there other diagnostic tools that would do better? 
    Here's what dtrace says right around the time it happened.   I was in Camino at the time. 
    $ sudo dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'
    Coming up on it...
      1  17728                       open:entry Safari /Users/harpwolf/Library/Keychains/Microsoft_Intermediate_Certificates
      1  17728                       open:entry Safari /Users/harpwolf/Library/Application Support/Adobe/AIR/ELS/com.adobe.amp.4875E02D9FB21EE389F73B8D1702B320485DF8CE.1/ PrivateEncryptedDatak
      1  18514              open_nocancel:entry DirectoryServic /etc/resolver
    BOOM IT JUST DID IT NOW
      1  17728                       open:entry ATSServer /.vol/234881026/8073/Courier.dfont
    OK it's over
    Is that at all useful?  I checked seconds later, there is no process "17728" and that's not even near the number of the processes being handed out at the time.
    $ ps -aef | grep 17728
      501 91064 91011   0   0:00.00 ttys001    0:00.00 grep 17728
    Thank you for any possible help.  This is driving me nutz.

    Gotcha.
    Sep 15 20:55:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 20:56:25: --- last message repeated 2 times ---
    Sep 15 21:01:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 21:02:25: --- last message repeated 2 times ---
    Sep 15 21:07:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 21:08:25: --- last message repeated 2 times ---
    Sep 15 21:13:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 21:14:25: --- last message repeated 2 times ---
    Sep 15 21:19:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 21:20:25: --- last message repeated 2 times ---
    Sep 15 21:25:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 21:26:25: --- last message repeated 2 times ---
    Sep 15 21:31:55 mymac Firewall[40]: Deny nmblookup data in from 192.168.1.1:137 uid = 0 proto=17
    Sep 15 21:32:25: --- last message repeated 2 times ---
    Now, what on earth is it???

Maybe you are looking for

  • Oracle NoSQL YCSB - continuously increasing execution time

    Greetings, currently I am testing several nosql databases using YCSB. I am new to that type of databases, but I have already tested few of them. I am using VM with 2GB RAM and hosted on Win 7. Even though it is not recommended, since I am working in

  • Invoke PI interface without Payload using URL only?

    Hi, Scenario is : HTTP<->XI<-->RFC. I do not need any payload from source system(HTTP). Is it possible to invoke this interface<b> without payload</b>. Requirement is to invoke this interface <b>using the URL only.</b> I have tested this interface wi

  • Third Party Logistics

    Hello Experts, I need the configuration data for 3rd Party Logistics.I couldnt able to find in forum also from Google. Does anybody have data. Thanks Shri.. Edited by: Lakshmipathi on Apr 28, 2011 9:03 AM Please avoid using abbreviated words and use

  • Opening Canon T2i raw files in CS5 Photoshop

    ACR 5.7 for CS4 opens raw files from my Canon T2i. CS5 Photoshop will not open my files. Did I really just pay $600 to take a step backward in camera compatibility? I have looked through the documentation and on the website and have now been on hold

  • DDI or DDK for Yes/No dropdown

    Hi Simple one this... I require a number of dropdowns (15) for Yes/No options. Should I use a dropdownbyIndex or dropdownbykey. If I use a dropdownbykey, am I right in thinking that I can use a domain that has X and space for a value and the Yes/No d