How to handle key events in popup component
Is there any possibility to handle keyboard events after a popup is opened
requirement : I want to close popup when I press escape key (by default this functionality is present but in some scenarios this is not working ) so explicitly i want to handle key events for popup.
Thanks,
Raghavendra.
in my application header part of the page is common of all page. header.jsff contains comandmenuItem named "proceduralhelp". if I click proceduralhelp a pop up opens .
in my login page when first time I open popup and press escape popup is not closing.
rest of the cases after login escpe will cose the popup.
only on the loginpage that to for the first time it is not closing when pressing up on escape key. (then we click on close button. and once again open the popup in loginpage now if we press escape it works).
Thanks,
Raghavendra.
Similar Messages
-
How to handle key events in iphone
I want to be able to detect physical keyboard (e.g. bluetooth) events in an iOS app.
In Mac, there is a class NSEvent which handles both keyboard and mouse events, and in ios (iphone/ipad) the counterpart of NSEvent is UIEvent which handles only touch events. I know ios API does not provide this functionality, but how can i handle key events in iphone???in my application header part of the page is common of all page. header.jsff contains comandmenuItem named "proceduralhelp". if I click proceduralhelp a pop up opens .
in my login page when first time I open popup and press escape popup is not closing.
rest of the cases after login escpe will cose the popup.
only on the loginpage that to for the first time it is not closing when pressing up on escape key. (then we click on close button. and once again open the popup in loginpage now if we press escape it works).
Thanks,
Raghavendra. -
How to handle selection event in alv component
Hi all,
i am new to webdynpro abap. and i want to know how to handle selection event(such as select all / unselect ) in my simple alv application.
Thanks very muchHi,
By default when you use the selection mode for the ALV as Multi/Mutli No Lead then this option is enabled.
Try to implement the event ONLEADSELECT and check wether this event is triggered or not.
DATA: lo_value type ref to cl_salv_wd_config_table.
CALL METHOD lo_value->if_salv_wd_table_settings~set_selection_mode
EXPORTING
value = cl_wd_table=>e_selection_mode-multi_no_lead.
Try to implement these event for ALV and put a break-point and test which event is getting triggered.
ON_CLICK
ON_DATA_CHECK
ON_FUNCTION
ON_LEAD_SELECT
ON_STD_FUNCTION_AFTE
ON_STD_FUNCTION_BEFO
Please provide more inputs.
Regards,
Lekha. -
How to handle key events in the Console?
Plz give sample code for it.
Thanks in advance.Don't have any experience with it personally, but I think curses does this type of thing http://sourceforge.net/projects/javacurses/
-
How to handle server event in component through BOL Concept
Hi All,
Please let me know how o handle Server event in Component through BOL Concept.
Thanks,
Prameela.Hi Prameela,
If you want the server event to be triggered in the search view, you have to add the code in the GET_DQUERY_DEFINITIONS method.
DATA: lv_getter TYPE string.
CONCATENATE 'GET_P_' <rt_result>-field INTO lv_getter.
TRANSLATE lp_getter TO UPPER CASE. "#EC SYNTCHAR
TRY.
CALL METHOD me->(lp_getter)
CHANGING
cs_result = <rt_result>.
CATCH cx_sy_dyn_call_illegal_method.
* no P-Getter found
ENDTRY.
Regards,
Leon -
I would like to create a subclass of TextBox that only allows numeric input. My idea was to provide my own onKeyType() handler and consume any key events that do not correspond to digits. However, I can't find any way to consume key events from further processing. How do I do this?
Are there any other suggestions how to accomplish the task of providing your own filter concerning valid key input?
/BengtI also wanted a kind of validators for the TextBox class of JavaFX. So I've tried solving the problem using the SwingTextField class and some Java APIs. The following is my code for a SwingTextField accepting only digits, but I do want it to be much simpler.
import java.awt.AWTEvent;
import java.awt.event.AWTEventListener;
import java.awt.event.KeyEvent;
import java.awt.Toolkit;
import javafx.ext.swing.SwingTextField;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javax.swing.JComponent;
class DigitKeyEventHookListener extends AWTEventListener {
public-init var source:JComponent;
public override function eventDispatched( event:AWTEvent):Void {
if (event.getSource().equals(source)) {
var keyEvent : KeyEvent = event as KeyEvent;
var keyCharacter = keyEvent.getKeyChar();
var isDigit = false;
var code = keyEvent.getKeyCode();
if ((KeyEvent.VK_0 <= keyCharacter) and (keyCharacter <= KeyEvent.VK_9)) {
isDigit = true;
if ((code ==KeyEvent.VK_DELETE) or (code ==KeyEvent.VK_BACK_SPACE)) {
isDigit = true;
if ((code ==KeyEvent.VK_LEFT) or (code ==KeyEvent.VK_RIGHT)) {
isDigit = true;
if (not isDigit) {
keyEvent.consume();
function createSwingTextField() : SwingTextField{
var field = SwingTextField {
columns:12
var listener = DigitKeyEventHookListener{
source: field.getJTextField()
Toolkit.getDefaultToolkit().addAWTEventListener(listener, AWTEvent.KEY_EVENT_MASK);
return field;
Stage {
title: "Digit Box"
width: 200
height: 80
scene: Scene {
content: createSwingTextField()
} -
Hello!
I have a component which extends JPanel. Now I dynamically add a JTextField as a child to this component. The problem is: when the textfield has focus, how can I get key events in my panel before the textfield gets them (and maybe intercept them so that the textfield doesn't get them at all)?
Background: the component is a self written table and the textfield is an editor. Now I have to make sure that when I am editing and press e.g. "cursor up", that not the textfield will get this key event but the table (which should traverse the current cell then ...)
The problem is: I cannot change the textfield (extend it or something) because a possible solution has to work with any java awt "Component" (or at least with JComponent).
Any help very appreciated.
MichaelHello,
implement the keyListener interface for the Extended component...
and in Keypressed method
keyPressed(keyEvent){
// do all ur reuirements here
//and comsume the keyEvent...
hope this helps -
How to handle Valuechange events, when page bean is in request scope
Hello balusc and forum mates,
I want to know is there any good way to handle ValueChangeEvents events, when the page's bean in request scope.
My problem is, I have a page having more than 1 value change event so How can I maintain page values at backing bean. My bean is request scope, I can't change to session scope.
Please I really need it.Hi Frank...
In my code i used almost same logic as Andrejus Baranovskis has explained in his Editable Table example...
You can refer that example to see what problem I'm facing...
http://andrejusb.blogspot.com/2007/04/create-edit-and-delete-operations-in.html
The Bean Scope in this Example is Session scope...Save button is working fine...
But as i Change the bean scope to Request scope then Save button is not working for Edit but it is working for Delete Action very well..
I want that save button should work also for Edit action in Request Scope..
Please Make me understand that why it is happened like that..
and help me to find the solution..
and Also if you have a better document to Explain the life cycle of Application in Different Bean Scope...So please provide me that Doc to me...
It would be a great help for me to understand the concept of session...
Thanks Frank
Fizzz... -
How to handle the events of business object (BAPI)
Hi,
How to register to BAPI event and handle?
For example, for a business object 'inv', there is an event as 'created'.
I want to insert entry in a z table when an inv is created.
I assume that the 'created' event is triggered when an inv is created.
How i can register to that event and handle that event so that i can
insert an entry in z table.
Thanks,
PrasadComponentListener?
: jay -
How to handle mousemove event in Acrobat?
Hi, i am working on Acrobat plugin. how to handle mouse move event in acrobat using Acrobat SDK?. i have created menuitem. when i selected menuitem is activated now i want to handle mouse move event acrobat.
Thanks in advanceThank You Leonard... For reply..
AVPageViewCursorProc callback used for cursor coordinate..
now i am displayed in the annotation.. but it is not show continuously... how can do it?
whenever cursor changes, cursor coordinate should be displayed properly in the annotation. may i get some suggestion or sample.
Thanks in advance.. -
How to generate key events to a componet without keyboard
I want to generate a key event, a Keylistener is already there, (in fact, java3D's KeyNavigatorBehavior). I want to use other input methods instead of key pressings, so how I generate the key event manually
thx,Look at java.awt.Robot. It has a keyPress() method to simulate key presses.
-
How to catch key events in JWindow???
Can somebody please suggest me how do I catch key events in a JWindow. I tried without success with addKeyListener( ) method. My sample code is attached below. I've j2sdk1.4.2_03 in my PC.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class EventCatcher extends JWindow implements KeyListener {
public EventCatcher() {
super();
Container c = getContentPane();
setBounds(100,100,400,400);
c.setLayout(new FlowLayout());
JButton button = new JButton("Hello");
c.add(button);
addKeyListener(this);
requestFocus();
setVisible(true);
public void keyReleased(KeyEvent ke) {
System.out.println("**************");
public void keyPressed(KeyEvent ke) {}
public void keyTyped(KeyEvent ke) {}
public static void main(String str[]) {
new EventCatcher();
Regards,
KoushikHi GraemeHook!
This is Khurram. I tried your code on my problem that is 95% like this problem but it could not be solved.
can u please take view on my code.
I m trying to move a frame that extends from JWindow on runtime with Key Board Arrow keys. but this only works when I extend this MainApp class from JFrame, but not when from JWindow.
can u please help me. I also posted my own topic but no one response so found it resambling to my problem.
hoping to hear from u soon
you can also tell me at my email address
[email protected]
thanks
===========================================================
MainApp.java
*MainApp.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MainApp extends JWindow {
static LocationManager appLoc = new LocationManager();
public MainApp() {
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
public static void main(String[] args) {
MainApp frm = new MainApp();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int width = screenSize.width;
int height = 45;
frm.setFocusableWindowState(true);
frm.setFocusable(true);
frm.setSize(width, height);
frm.setLocation(appLoc.setAppAtBottomCentered(width, height));
frm.setLocation(appLoc.moveAppUpward(100));
frm.setVisible(true);
private void jbInit() throws Exception {
this.getContentPane().setBackground(Color.white);
addKeyListener(new java.awt.event.KeyAdapter(){
int moveSpeed = 4;//must be even
public void keyPressed(KeyEvent e){
//JOptionPane.showMessageDialog(null,""+e.getKeyCode());
if(e.getKeyCode() == KeyEvent.VK_SHIFT)
if(moveSpeed==4)
moveSpeed = 12;
else
moveSpeed = 4;
if(e.getKeyCode() == KeyEvent.VK_UP)
setLocation(appLoc.moveAppUpward(moveSpeed));
else if(e.getKeyCode() == KeyEvent.VK_DOWN)
setLocation(appLoc.moveAppDownward(moveSpeed));
else if(e.getKeyCode() == KeyEvent.VK_LEFT)
setLocation(appLoc.moveAppToLeft(moveSpeed));
else if(e.getKeyCode() == KeyEvent.VK_RIGHT)
setLocation(appLoc.moveAppToRight(moveSpeed));
else if(e.getKeyCode() == 107) {//NUMPAD '+' Key For Vertically Increasing
setSize(appLoc.increaseSize(0,moveSpeed));
setLocation(appLoc.updateLocation());
else if(e.getKeyCode() == 109) {//NUMPAD '-' Key For Vertically Decreasing
setSize(appLoc.decreaseSize(0,moveSpeed));
setLocation(appLoc.updateLocation());
else if(e.getKeyCode() == 61) {// '+' Key For Horizontal Increasing
setSize(appLoc.increaseSize(moveSpeed,0));
setLocation(appLoc.updateLocation());
else if(e.getKeyCode() == 45) {// '-' Key For Horizontal Decreasing
setSize(appLoc.decreaseSize(moveSpeed,0));
setLocation(appLoc.updateLocation());
}====================================================================
LocationManager.java
* LocationManager.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.sql.*;
public class LocationManager {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
static Point newPoint = new Point();
static Dimension newDim = new Dimension();
static Dimension minDim = new Dimension();
/** Creates a new instance of LocationManager */
public LocationManager() {
public LocationManager(int width, int height){
this.setAppCenteredWithDim(width, height);
public Point setAppCenteredWithDim(int width, int height){
//Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
newDim.width = width;
newDim.height = height;
int sWidth = screenSize.width;
int sHeight = screenSize.height;
newPoint.x = (sWidth-width)/2;
newPoint.y = (sHeight-height)/2;
return newPoint;
//return new Point(this.x, this.y);
public Point setAppAtTopCentered(int width, int height){
//Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
newDim.width = width;
newDim.height = height;
int sWidth = screenSize.width;
int sHeight = screenSize.height;
newPoint.x = (sWidth-width)/2;
newPoint.y = 0;
return newPoint;
//return new Point(this.x, this.y);
public Point setAppAtBottomCentered(int width, int height){
//Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
newDim.width = width;
newDim.height = height;
int sWidth = screenSize.width;
int sHeight = screenSize.height;
newPoint.x = (sWidth-width)/2;
newPoint.y = (sHeight-height);
return newPoint;
//return new Point(this.x, this.y);
public Point setAppAtRightCentered(int width, int height){
//Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
newDim.width = width;
newDim.height = height;
int sWidth = screenSize.width;
int sHeight = screenSize.height;
newPoint.x = 0;
newPoint.y = (sHeight-height)/2;
return newPoint;
//return new Point(this.x, this.y);
public Point setAppAtLeftCentered(int width, int height){
//Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
newDim.width = width;
newDim.height = height;
int sWidth = screenSize.width;
int sHeight = screenSize.height;
newPoint.x = (sWidth-width);
newPoint.y = (sHeight-height)/2;
return newPoint;
//return new Point(this.x, this.y);
public Point moveAppUpward(int step){
newPoint.y -= step;
return newPoint;
//return new Point(this.x, this.y);
public Point moveAppDownward(int step){
newPoint.y += step;
return newPoint;
//return new Point(this.x, this.y);
public Point moveAppToLeft(int step){
newPoint.x -= step;
return newPoint;
//return new Point(this.x, this.y);
public Point moveAppToRight(int step){
newPoint.x += step;
return newPoint;
//return new Point(this.x, this.y);
public Dimension increaseSize(int w, int h){
minDim.width = 116;
minDim.height = 56;
newDim.width += w;
newDim.height +=h;
if(w==0 && newDim.height > minDim.height)
newPoint.y -= h/2;
else if(newDim.width > minDim.width )
newPoint.x -= w/2;
return newDim;
public Dimension decreaseSize(int w, int h){
minDim.width = 116;
minDim.height = 56;
if(newDim.width > minDim.width )
newDim.width -= w;
if(newDim.height > minDim.height)
newDim.height -= h;
if(w==0 && newDim.height > minDim.height)
newPoint.y += h/2;
else if(newDim.width > minDim.width)
newPoint.x += w/2;
return newDim;
public Point updateLocation(){
return newPoint;
//return new Point(this.x, this.y);
}=================================================================== -
hi all,
The softkeys varies form device to device.so kidly say some genric way to handle softkey events.
Thanks in advance
BadriThe only "generic" way to handle softkeys is to use Commands.
shmoove -
What is a proper way of using a dynamic event in Popup in order to send a message from it to the main application?
ThanksIf they are All-Day events, then they will be overlaid with the Calendar color. If they are not all-day, then they will just have a dot. There is no way to alter that behavior.
-
How to handle keypressed event for form
i have to handle keypressed event of a textfield control.
I have tried by implementing itemstatechangelistner ........
but as api specifies its behavior varies from device to device....it is guaranteed that the control is notified when losing its focus. But my requirement is to get notified for every keypressed time.....
any idea.....pls help meCan't be done for TextField. Many devices (example:SE k700i) launch a separate editing screen to change the text in a TextField.
db
Maybe you are looking for
-
How do i stop my Yahoo email from auto signing me into it when i sign into firefox
when i sign into firefox, and if i have new email, my email auto opens when i sign into firefox. i don't have to give my password. in the bottom right part of the page, a box pops up and says i have (so many) new emails, there is a box to click on an
-
After updating Firefox I start getting calls from 253-802-0308 (International Telcom in Auburn Washington, found using 411.com). The report that they are getting messages that my Windows PC is reporting the downloading of malicious files. I don't thi
-
Problems on my Lumua 620 after Black update
The battery backup of Lumia 620 is really very very disappointing. I cant believe the Nokia manufactured phones will have such low battery backup. It hardly gives a backup of 7 hours. With WhatsApp, Hike and other messaging apps, data connection has
-
UCS 1.4(3M) BIOS Issue ? no network/san boot when diskless
Recreated faithfully on multiple blades and chassis with VIC cards. Have many SAN boot nodes in production and testing and after upgrading firmware this week anytime I apply my store policy of "diskless" to a blade I lose the ability to boot fro
-
Windows 10 TP build 10041 seen as Windows 8.1 OS when imported to a Deployment Share
Hi all, I tried to import the Windows 10 TP build 10041 as operating system to a new deployment share created with MDT 2013 U1. I referenced the DVD iso image of Windows 10 Technical Preview 10041 and os type was recognized as Windows 8.1. Is there a