You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gatos <eg...@gmail.com> on 2010/02/04 15:56:06 UTC

document onkeypress onkeydown

  Hello,

How is it possible to add event behavior for the document?

I tried this one, but it didn't work:

add(new AjaxEventBehavior("onkeypress"){
  @Override
  protected void onEvent(final AjaxRequestTarget target) {
      LOG.debug("keypress");
  }
  });

Re: document onkeypress onkeydown

Posted by Stefan Fussenegger <st...@molindo.at>.
Add a WebMarkupContainer to <body>, i.e.

<body wicket:id="body">...</body>

add(new WebMarkupContainer("body")
	.add(new AjaxEventBehavior("onkeypress"){
		protected void onEvent(final AjaxRequestTarget target) {
			LOG.debug("keypress");
		}
	}));


Gatos wrote:
>   Hello,
> 
> How is it possible to add event behavior for the document?
> 
> I tried this one, but it didn't work:
> 
> add(new AjaxEventBehavior("onkeypress"){
>   @Override
>   protected void onEvent(final AjaxRequestTarget target) {
>       LOG.debug("keypress");
>   }
>   });
> 

-- 

Stefan Fußenegger
Molindo GmbH
http://techblog.molindo.at/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org