Re: Ajax call of textfield after pressing the Enter key

2013-04-27 Thread Martin Grigorov
Hi,


On Sat, Apr 27, 2013 at 12:31 AM, Andre Schütz wic...@faustas.de wrote:

 Hello,

 I tried to find out how I can make a Ajax call from a textfield after
 pressing the Enter key. I want to reach the following:
 - The user types a name into the textfield
 - After pressing the Enter key, the value of the textfield will be
 processed on the server side

 I tried AjaxFormSubmitBehavior and AjaxFormComponentUpdatingBehavior
 without success.
 Can anyone help me with an example?


Both behaviors will do the job.
You should listen on keypress or keyup event and you should have a
AjaxCallListener precondition that checks that the pressed key is Enter
(Wicket.Event.keyCode(attrs.event) === 27)



 --
 Andre Schütz wic...@faustas.de

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




-- 
Martin Grigorov
Wicket Training  Consulting
http://jWeekend.com http://jweekend.com/


Re: Ajax call of textfield after pressing the Enter key

2013-04-27 Thread vineet semwal
hi,
just minor correction, enter key is 13 ..



On Sat, Apr 27, 2013 at 11:34 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,


 On Sat, Apr 27, 2013 at 12:31 AM, Andre Schütz wic...@faustas.de wrote:

  Hello,
 
  I tried to find out how I can make a Ajax call from a textfield after
  pressing the Enter key. I want to reach the following:
  - The user types a name into the textfield
  - After pressing the Enter key, the value of the textfield will be
  processed on the server side
 
  I tried AjaxFormSubmitBehavior and AjaxFormComponentUpdatingBehavior
  without success.
  Can anyone help me with an example?
 

 Both behaviors will do the job.
 You should listen on keypress or keyup event and you should have a
 AjaxCallListener precondition that checks that the pressed key is Enter
 (Wicket.Event.keyCode(attrs.event) === 27)


 
  --
  Andre Schütz wic...@faustas.de
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


 --
 Martin Grigorov
 Wicket Training  Consulting
 http://jWeekend.com http://jweekend.com/




-- 
regards,

Vineet Semwal


Ajax call of textfield after pressing the Enter key

2013-04-26 Thread Andre Schütz
Hello,

I tried to find out how I can make a Ajax call from a textfield after pressing 
the Enter key. I want to reach the following:
- The user types a name into the textfield
- After pressing the Enter key, the value of the textfield will be processed on 
the server side

I tried AjaxFormSubmitBehavior and AjaxFormComponentUpdatingBehavior without 
success.
Can anyone help me with an example?

-- 
Andre Schütz wic...@faustas.de

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