see how onchangeajaxeventbehavior works, you want something like that
but attached to the onkeydown event

-igor

On Wed, Sep 17, 2008 at 8:59 AM, ulrik <[EMAIL PROTECTED]> wrote:
>
> How do I do that?
>
> //Ulrik
>
>
> igor.vaynberg wrote:
>>
>> use onkeydown to update your model
>>
>> -igor
>>
>> On Wed, Sep 17, 2008 at 2:44 AM, ulrik <[EMAIL PROTECTED]> wrote:
>>>
>>> Hello!
>>>
>>> I have my own class, which I call AjaxTextField:
>>>
>>> public class AjaxTextField extends TextField {
>>>
>>>    public AjaxTextField(String s, PropertyModel propertyModel) {
>>>        super(s, propertyModel);
>>>
>>>        OnChangeAjaxBehavior _onChangeAjaxBehavour = new
>>> OnChangeAjaxBehavior(){
>>>            protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
>>>            }
>>>        };
>>>        this.add(_onChangeAjaxBehavour);
>>>    }
>>> }
>>>
>>> This works gret, everytime I enter something in the TextField, the model
>>> gets updated. The problem is when I erase the input from the TextField.
>>>
>>> Scenario:
>>>
>>> 1) I enter "Hello" in the textfield
>>> 2) Refresh the page
>>> 3) The text "Hello" is still in the textfield ---> great
>>> 4) I erase the string "Hello" from the textfield
>>> 5) refresh the page
>>> 6) The textfield is not empty..the "H" is still there
>>>
>>> It seems like the model gets updated until I try to erase the last
>>> (first)
>>> token in the textfield.
>>>
>>> Does anybody know why this is?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/TextField-with-OnChangeAjaxBehavior-tp19527799p19527799.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/TextField-with-OnChangeAjaxBehavior-tp19527799p19535405.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to