Home > GWT - GXT > GXT – Listener for ContentPanel

GXT – Listener for ContentPanel

Lastly, I wanted to display a search panel, e.g. if you F3 button press. It is possible that you need such functionality.

E.g. any interaction must be made if you have press any character on your keyboard.

For this we must simply add a listener to appropriate containers.

cpView.addListener(Events.OnKeyPress, new Listener() {
   @Override
   public void handleEvent(BoxComponentEvent be) {
      if(be.getKeyCode() == 115){ // F4
         toggleSearchPanel();
      }
   }
});

Or you can add a grid to those listeners, resulting in immediate search panel is displayed when you press F4 in Grid.

cpGrid.addListener(Events.OnKeyPress, new Listener() {
   @Override
   public void handleEvent(ComponentEvent be) {
      if(be.getKeyCode() == 115){ // F4
         toggleSearchPanel();
      }
   }
});

 

Advertisements
Categories: GWT - GXT Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: