How to close a popup using a function key in adf + Jquery

Hello All,
I want to display some error message using function key so I have used javascript function
*function showText(event) {*
var k = event.getKeyCode();
*if (k == 115) {*
------------------------------------------CODE-------------------------------------------
This is working fine on click of F4 it is invoking a popup and inside that popup in dialog it is showing some error messages. The property modal of dialog is true. So that user should not be able to navigate to main form until error message is closed.
Now on click of F6 I want that error message to be closed. When I added af:clientListener on popup or dialog type="keyDown" is not available.
So I thought using jquery for this. I have created a form.js file inside that I have written:
*$(function first()*
*               jQuery('*').bind('keydown', 'F6', function (evt){closePopup();evt.stopPropagation();return false;});*
*function closePopup(){*
*     alert("Do you want to close the error message");*
I have also added jquery.hotkeys.js and jquery-latest.js file.
My question here is How can i find that popup or dialog inside that jquery function and close it?
On click of F6 I am getting that alert Do you want to close the error message but after that how can I find the popup or dialog and close it?
I am new to jquery still I tried using some code:
var dialog = event.getSource();
var popup = dialog.findComponent("p1");
popup.close();
and
var output1 = AdfUIComponent.findComponent("p1");
output1.close();
and
curElm = document.activeElement;
var frm = curElm.close();
But none of them worked.
Please help
Thanks

Hi,
this whitepaper: http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf has an example of registering keyboard keys on a global level (see page 36). So you would define a key to close dialogs in general. The paper also explains how to search and find components. Note that you should always work with the ADF Faces client side API and never against the generated markup or DOM (which in fact your code does)
Frank

Similar Messages

  • How can I use the function keys in a GUI with swing?

    I'm wondering how do you declare you want an action to happen when a user uses a function key or any key for that matter. How can you specify something frame wide or for that matter for a specific jtextbox?

    you need to use an accelerator
    setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)

  • How to use standard function keys as custom keys

    how to use standard function keys as custom keys.
    i have encountered that problem while developing a screen, there i'm supposed to use standard function key F2 ( which actually meant for choose) for clearing the screen fields where the cursor is present and f1 for saving data that entered in screen fields, etc...
    kindly help me out.

    Hi ,
    Solution to use SAP reserve function keys F1 .. F4 (mostly this requirement comes up for RF screens) can be acheived by assigning your new Function code using the Menu path Utilities --> F key Consistency in the Menu Painter (SE41) . Once you assign your cutom function code to the standard Fn keys the only remaining step is to make sure that you set a curson on any of the field on sceen by using the Key Word "SET CURSOR" .
    If you dont use the key word SET CURSOR in the PBO of the screen then you might not see any response for F4.
    Thanks

  • Hi fellow apple guys, i have this problem. Hope you can help me. I don't know how to use the function keys (F1 to F12) on my macbook air. Pls help

    Hi fellow apple guys, i have this problem. Hope you can help me. I don't know how to use the function keys (F1 to F12) on my macbook air. Pls help

    Out of the box, to use the function keys as function keys, hold down the fn key when you press the key. Otherwise, you get the picture function on the key. You can reverse this behavior in the Keyboard system prefs.

  • Hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to

    hey i hav an hp pavilion g series n i would like to kno how use the function keys without having to click on the fn + function key

    Hi,
    You can change this in your system bios as described in the link below.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02035108&cc=us&dlc=en&lc=en&jumpid=reg_R1002_US...
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • How to close a popup window for system events?

    Hi,
    I have a screen 110 which shows several input field in popup mode.
    The Cancel button can close the screen.
    But my question is how to close the popup window for the following system events?
    1, Customer clicks the cross button in top-right corner
    2, Customer clicks the system icon in top-left corner and then select either: "Close" or "Stop Session"
    The PAI subroutine of the screen has not been triggered for the above system events.
    Thanks for the coming help.
    Best Regards,
    David

    Hi Siddharth,
    I did check with another very experienced ABAP developer.
    The solution was the same as what Arunima Rudra provided.
    And I got a sample program which did work properly.
    The headache is that the system events in my program still cannot be triggered even after I have all the same changes.
    Anyway, I suggest you to try the solution as provided by Arunima Rudra.
    It should work for 2 system events:
    1, Customer clicks the cross button in top-right corner
    2, Customer clicks the system icon in top-left corner and then select either: "Close"
    For "Stop Session", it should not be handled by popup.
    You can observe the same behavior in ALV sorting configuration popup.
    Good luck!
    Regards,
    David

  • How can and where i use the function "HTMLDB_UTIL.CLEAR_PAGE_CACHE "

    how can and where i use the function "HTMLDB_UTIL.CLEAR_PAGE_CACHE " ?
    where is the place to put this function?

    i have notice that sometime, during visual a report of a table, order by data insert desc, some record are not displayed on some client.
    Only whe we clear the cache of internet explorer than this record can view.
    I have an idea that a clear page when i call the report may be solve the problem.
    Thank's.
    ------------------------

  • How do I turn off the requirement to press control when using a function key

    When using my wireless keyboard, it requires me to press controls to use the function keys (F3, F5, F70.) However, this makes it so some of my games controls won' work,(For example, in Minecraft I can't access the debug menu.) Is there any way to disable this.Thank you for your support

    Please take these steps if you're prompted for a password when moving items in your home folder to the Trash.
    1. Triple-click anywhere in the line below on this page to select it:
    ~/.Trash
    2. Right-click or control-click the highlighted line and select
    Services ▹ Show Info in Finder (or just Show Info)
    from the contextual menu.* An Info dialog should open.
    3. The dialog should show "You can read and write" in the Sharing & Permissions section. If that's not what it shows, click the padlock icon in the lower right corner of the window and enter your password when prompted. Use the plus- and minus-sign buttons to give yourself Read & Write access and "everyone" No Access. Delete any other entries in the access list.
    4. In the General section, uncheck the box marked Locked if it's checked.
    5. From the action menu (gear icon) at the bottom of the dialog, select Apply to enclosed items and confirm.
    6. Close the Info window and test.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. Open a TextEdit window and paste into it (command-V). Select the line you just pasted and continue as above.

  • How to replace F4 using another function key

    Experts:
       How can i change the search help function key F4, using another function key,for example F11, when i press F11 the system perform the search help.
    thanks!

    you can do this using menus/buttons(dialog programming) and there you can define your short keys, and event can be trapped by sy-ucomm in the program. Menu can be set by writting set PF-Status 'MENUNAME' or using se37.

  • How do you reset the special keyboard function keys?

    I used to use an older external keyboard that had Dashboard as F4. Now I got a newer keyboard that has Launchpad as F4. I was used to the old way, so I went into the keyboard shortcut for Dashboard and set it as F4. To my disappointment, however, it only works when I hold 'fn'. (I didn't expect this, as when the key was set to F13 holding fn wasn't required.) So anyway, that is even worse, and I wanted to change it back. However, it wouldn't let me. (In Launchpad & Dock > Keyboard Shortcuts, there used to be a checkmark next to Show Launchpad with a blank area on the right, but now when I try to click Restore Defaults, it forces me to choose a key... and pressing F4 without holding fn doesn't register.) And I know I can make it use all function keys as standard function keys, but not just for F4. And if I do it for all of them, I lose the other keyboard controls and I don't want that. I don't want to have to be stuck with the FunctionFlip 3rd party tool forever... How can I actually reset they key (or ideally, make it bring up dashboard without holding down fn)? You'd think that if it's so simple to change a setting one way it would be simple to change back. I'd even delete some prefs file if i had to.

    I figured out that if you remove the ~/Library/Preferences/com.apple.symbolichotkeys.plist file and restart, that restores the keyboard.
    Second question: Is there any way to make F4 (without holding fn) bring up Dashboard on Lion that doesn't require FunctionFlip? If it matters, I have a Time Machine backup of the symbolichotkeys.plist file from when I had the older keyboard.

  • Using of function keys (F1, F2...) in Java Webdynpro

    Hi
    i would like to ask whether we can use the function keys like f1, f2, .....in the java webdynpro applications
    and if so how it is possible to do so
    Regards
    JM

    thanks
    where will i get a list of keys that you were refering
    " some keys are reserved by the browser and cannot be used by Web Dynpro applications. "
    and secondly i want to know about the function keys (f1, f2....)whether we can use these function keys in java webdynpro and not for hot keys
    if you can share the information with me it would be good
    Regards
    JM

  • How to close a popup window in a used component?

    Hi Experts,
    I have two applications in the same project, and they each have one component controller. Let they be component A and B. They have similar functionalities and screens. There is a popup window in A that I would like to use in B instead of creating a new popup window in B, so I added a used component of A in B in order to share the popup window. I am able to click a button in B to get a popup window from A successfully, but I am unable to close the popup window since the event has been created in A.
    Can anyone suggest me how to fix this please? I would really appreciate your help.
    Thanks,
    -Napadol

    Hi,
    You can either use the approach above, which is having an Attribute, type IWDWindow in B's Component Context. When you open the popup you store the reference. When you click close you get that reference back and destroy the window.
    Note, I'd suggest you to have your "View" with no Close Button. Then in Component A you create another View that has an UIViewContainer with your Popup View. You can code the Close code in Component A.
    This way you can do the same and have a code in Component B to close your window.
    Other way would be having it as a Component variable and using the Component Interface on A (create a Method) that goes to Component A and destroy that instance.
    Regards,
    Daniel

  • How to open modal popup using javascript in iPad ?

    Hi Apps masters
    How to open modal dialog ?
    How to return selected value to parent value ?
    How to close modal dialog ??
    Thanks,

    Hi,
    Try This
    function aboutOkButton(event) {
    var v= event.getSource();
    var popup = v.findComponent("popupId");
    popup.hide();
    event.cancel();
    Sameh Nassar

  • How to use the Function keys as function keys instead of action keys?

    When I press F1 or any of the other F keys it does what the symbol says on the key (volume/skip track etc).
    How do I actually use the F keys and not the symbols?

    Hi again John,
    ...is there a way to switch that around so I use the "fn" key for sound etc?
    Do the following:
    1. Fire up System Preferences
    2. Select Keyboard & Mouse
    3. Select the Keyboard tab.
    4. Tick the "Use all F1, F2, etc. keys as standard function keys" box.
    That's it. You have now reversed the default use of the function keys. If you need to increase/decrease sound, brightness etc then press 'fn' plus the appropriate function key.
    Kryten

  • How to create textpool by using standard function module?

    hi,
    gurus.
    I have find two function modules ( RS_TEXTPOOL_READ / BX_AGR_READ_TEXTPOOL ) which is used to read but i want to write into the textpool is there any standard function module

    REPORT ZTEST1.
    WRITE : / 'ddddddd'.
    WRITE : / 'ddddddd'.
    WRITE: / 'hhhhhhh'.
    WRITE: / 'ddddddd'.
    WRITE: / 'ddddddd' , 'uuuuuuuu'.
    WRITE: / 'ddddddd', 'sssssssss'.
    for example i am this report i want to convert it into text elements like
    REPORT ZTEST1.
    WRITE : / 'text-001'.
    WRITE : / 'text-001'.
    WRITE: / 'text-002''.
    WRITE: / 'text-001''.
    WRITE: / 'text-001'' , 'text-003''.
    WRITE: / 'text-001'', 'text-004'.
    this elements also store into the textpool so how can we achieve  this functionality by using standard function module.
    can any body give some idea .
    shabeer ahmed

Maybe you are looking for

  • Anyone knows this problem?

    I get the same message everytime after assigning a setting and destination in compressor after i click the submit button " one or more targets are incomplete" What is it that i am doing wrong? I follow the user manual but still no result. Please anyo

  • HT1338 desk top is running very slow

    internet is running very slow

  • Workflow Notifications not sending for AdHoc Role

    Hi, I am trying to send my workflow to multiple dynamic users, using the call createAdHocRole. Here is my code (I currently am using 2 user names for testing. This will be eventually be a variable) : +-- create role --+ apps.wf_directory.createAdHocR

  • Connection Timeout Error

    Hi Experts,   I  am trying to send a file from MDM to ECC in the FTP folder. Everything, the configurations and the connections are fine. But i m getting this error "Error occurred while connecting to the FTP server "psimdm:21": java.net.ConnectExcep

  • Safari Flash Player

    my flash player for safari is no longer working. when i reinstalled the flash player i only see the quicktime logo with a question mark over it. in the past i've had problems with flash, a video i would be watching streaming would skip frames and to