You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniele Dellafiore <il...@gmail.com> on 2008/10/28 14:35:07 UTC

OnChangeAjaxBehavior receives only first input character

Hi all.

I am using an OnChangeAjaxBehavior on a textField to filter contents
of a table.
My code is very similar to this example:
http://www.wicket-library.com/wicket-examples/ajax/on-change-ajax-behavior

The problem I have is that the first input character is received and I
can get it in the onUpdate method of the Behavior. Then it stops
sending event, the wicket ajax debug console confirm that nothing is
sent anymore. If I remove and give the focus back to the field, I
receive a new character, and only one again.

Here is the debug console output for the first char I receive.

INFO: focus removed from
INFO: focus set on filter5
INFO:
INFO: Initiating Ajax POST request on
?wicket:interface=:2:authorSearch:form:filter::IBehaviorListener:0:&random=0.08630731350941423
INFO: Invoking pre-call handler(s)...
INFO: Received ajax response (261 characters)
INFO:
<?xml version="1.0" encoding="UTF-8"?><ajax-response><component
id="authors6" ><![CDATA[<table id="authors6">

<thead>


    <tr class="headers">

            <th><span>Nome</span></th>

    </tr>


</thead>


<tbody>

</tbody>
</table>]]></component></ajax-response>
INFO: Response parsed. Now invoking steps...
INFO: Response processed successfully.
INFO: Invoking post-call handler(s)...
INFO: Calling focus on filter5
INFO: focus removed from filter5

-- 
Daniele Dellafiore
http://blog.ildella.net/

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


Re: OnChangeAjaxBehavior receives only first input character

Posted by Daniele Dellafiore <il...@gmail.com>.
I fixed it. The problem is that the copmponent I want to update was
outside the form.

On Tue, Oct 28, 2008 at 3:51 PM, Nino Saturnino Martinez Vazquez Wael
<ni...@jayway.dk> wrote:
> Hi Daniele
>
> Provide your code, java and html cutout, it's clearly not similar then it
> would work..
>
> Daniele Dellafiore wrote:
>>
>> Hi all.
>>
>> I am using an OnChangeAjaxBehavior on a textField to filter contents
>> of a table.
>> My code is very similar to this example:
>> http://www.wicket-library.com/wicket-examples/ajax/on-change-ajax-behavior
>>
>> The problem I have is that the first input character is received and I
>> can get it in the onUpdate method of the Behavior. Then it stops
>> sending event, the wicket ajax debug console confirm that nothing is
>> sent anymore. If I remove and give the focus back to the field, I
>> receive a new character, and only one again.
>>
>> Here is the debug console output for the first char I receive.
>>
>> INFO: focus removed from
>> INFO: focus set on filter5
>> INFO:
>> INFO: Initiating Ajax POST request on
>>
>> ?wicket:interface=:2:authorSearch:form:filter::IBehaviorListener:0:&random=0.08630731350941423
>> INFO: Invoking pre-call handler(s)...
>> INFO: Received ajax response (261 characters)
>> INFO:
>> <?xml version="1.0" encoding="UTF-8"?><ajax-response><component
>> id="authors6" ><![CDATA[<table id="authors6">
>>
>> <thead>
>>
>>
>>    <tr class="headers">
>>
>>            <th><span>Nome</span></th>
>>
>>    </tr>
>>
>>
>> </thead>
>>
>>
>> <tbody>
>>
>> </tbody>
>> </table>]]></component></ajax-response>
>> INFO: Response parsed. Now invoking steps...
>> INFO: Response processed successfully.
>> INFO: Invoking post-call handler(s)...
>> INFO: Calling focus on filter5
>> INFO: focus removed from filter5
>>
>>
>
> --
> -Wicket for love
>
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Daniele Dellafiore
http://blog.ildella.net/

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


Re: OnChangeAjaxBehavior receives only first input character

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hi Daniele

Provide your code, java and html cutout, it's clearly not similar then 
it would work..

Daniele Dellafiore wrote:
> Hi all.
>
> I am using an OnChangeAjaxBehavior on a textField to filter contents
> of a table.
> My code is very similar to this example:
> http://www.wicket-library.com/wicket-examples/ajax/on-change-ajax-behavior
>
> The problem I have is that the first input character is received and I
> can get it in the onUpdate method of the Behavior. Then it stops
> sending event, the wicket ajax debug console confirm that nothing is
> sent anymore. If I remove and give the focus back to the field, I
> receive a new character, and only one again.
>
> Here is the debug console output for the first char I receive.
>
> INFO: focus removed from
> INFO: focus set on filter5
> INFO:
> INFO: Initiating Ajax POST request on
> ?wicket:interface=:2:authorSearch:form:filter::IBehaviorListener:0:&random=0.08630731350941423
> INFO: Invoking pre-call handler(s)...
> INFO: Received ajax response (261 characters)
> INFO:
> <?xml version="1.0" encoding="UTF-8"?><ajax-response><component
> id="authors6" ><![CDATA[<table id="authors6">
>
> <thead>
>
>
>     <tr class="headers">
>
>             <th><span>Nome</span></th>
>
>     </tr>
>
>
> </thead>
>
>
> <tbody>
>
> </tbody>
> </table>]]></component></ajax-response>
> INFO: Response parsed. Now invoking steps...
> INFO: Response processed successfully.
> INFO: Invoking post-call handler(s)...
> INFO: Calling focus on filter5
> INFO: focus removed from filter5
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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