You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2013/05/22 09:04:46 UTC

AjaxRequestAttributes#allowDefault in 6.8.0

Hi,

I think we need 6.8.1 because of the problem in
https://issues.apache.org/jira/browse/WICKET-5194.
The quickstart shows that textField.add(new AjaxEventBehavior("keydown"))
doesn't work because the event' default behavior is prevented.

org.apache.wicket.ajax.attributes.AjaxRequestAttributes#allowDefault
default value was 'false' since 6.0.0 but it seems it was not used at all
in many cases before the changes in WICKET-5093:

https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09
https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30

I suggest to change the default value of 'allowDefault' to 'true'.

Do you see any use cases where the value should be 'false' ?
The 'false' value was because AjaxFallbackLink should not execute it
default behavior - following its href location. But here really the
effective JS event property is 'stopPropagation' which has been extracted
to its own property in AjaxRequestAttributes.

A workaround is to use:

getAjaxRequestTargetListeners().add(new AjaxRequestTarget.AbstractListener()
{
 @Override
public void updateAjaxAttributes(AjaxRequestAttributes attributes)
{
 super.updateAjaxAttributes(attributes);

attributes.setAllowDefault(true);
}
 });

in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
released.

What do you think ? Should we fix this and release 6.8.1 as soon as
possible ?

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Andrea Del Bene <an...@gmail.com>.
After some experiments with the quickstart I think Sven is right. With 
version 6.6.0 it's also impossible to insert an input. However with ver 
6.7.0 is "almost" impossible, meaning that the behavior is a little 
weird. Initially it's impossible, but if you move to the surname field 
and then back to the name field, some characters are randomly accepted.
> It's been that way ever since:
>
> "keydown" with allowDefault=false -> not character input
>
> Sven
>
> On 05/22/2013 12:07 PM, Martin Grigorov wrote:
>> The quickstart in the ticket is very simple, there is no usage of
>> throttling.
>> It's just:
>>
>> textField.add(new AjaxEventBehavior("keydown") {
>>   @Override
>> protected void onEvent(AjaxRequestTarget target) {
>> System.err.println("event");
>>   }
>> });
>>
>> Without explicitly allowing the default behavior the user cannot enter a
>> single character in the <input type=text>.
>>
>>
>> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:


Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
Please file a ticket so I don't forget and I'll change it.
Or you do it :-)


On Wed, May 22, 2013 at 5:01 PM, Sven Meier <sv...@meiers.net> wrote:

> Hi Martin,
>
> I'd say we should change it for 7.x only.
>
> For 6.x it's better to leave it STOP, since that corresponds to the
> behavior before "eventPropagation" was introduced.
>
> Sven
>
>
> On 05/22/2013 03:46 PM, Martin Grigorov wrote:
>
>> On Wed, May 22, 2013 at 4:41 PM, Sven Meier <sv...@meiers.net> wrote:
>>
>>  With Wicket 7.0.0 we will follow the jquery convention with
>>> "preventDefault" initially set to false.
>>>
>>> @Martin:
>>> Shouldn't ARA#eventPropagation set to BUBBLE initially? That would be
>>> consistent with jquery too.
>>>
>>
>> This is how it was in 6.7.0 and there were two users complaining about the
>> changed behavior, so we reverted it in 6.8.0 to what it was till 6.6.0.
>> Do others think that bubble should be the default ?
>>
>>
>>
>>
>>> Sven
>>>
>>>
>>> On 05/22/2013 03:34 PM, Nick Pratt wrote:
>>>
>>>  Hi Martin
>>>>
>>>> I didnt mean to imply that we should change the functionality, just
>>>> that I
>>>> think we should follow the convention of whatever jquery/JS do, except
>>>> in
>>>> the cases where components need to alter this behavior for their correct
>>>> functionality. So if the JS/jquery default is to allow event
>>>> propagation,
>>>> then Wicket should default to this same behavior, except where noted.
>>>>
>>>> N
>>>>
>>>>
>>>> On Wed, May 22, 2013 at 8:44 AM, Martin Grigorov <mgrigorov@apache.org
>>>>
>>>>> wrote:
>>>>>
>>>>   Hi Nick,
>>>>
>>>>>
>>>>> On Wed, May 22, 2013 at 3:30 PM, Nick Pratt <nb...@gmail.com> wrote:
>>>>>
>>>>>   With regards to the default setting of this value, I think we should
>>>>> follow
>>>>>
>>>>>  whatever jquery / JS does by default (I dont know whether this is the
>>>>>>
>>>>>>  case
>>>>>
>>>>>  or not). I think events propagate by default, so any provided
>>>>>> components
>>>>>> that need to alter this behavior should explicitly set (false) for
>>>>>> this
>>>>>> value.
>>>>>>
>>>>>>   We need to prevent the default for AjaxFallback** components because
>>>>>>
>>>>> otherwise both the Ajax and the non-Ajax behaviors will be executed.
>>>>>
>>>>> We need to stop the propagation of the event by default because
>>>>> otherwise
>>>>> you may get more than one Ajax calls when you click on a link which is
>>>>> inside a div which also has listener for 'click' (WICKET-5093).
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Sven Meier <sv...@meiers.net>.
Hi Martin,

I'd say we should change it for 7.x only.

For 6.x it's better to leave it STOP, since that corresponds to the 
behavior before "eventPropagation" was introduced.

Sven

On 05/22/2013 03:46 PM, Martin Grigorov wrote:
> On Wed, May 22, 2013 at 4:41 PM, Sven Meier <sv...@meiers.net> wrote:
>
>> With Wicket 7.0.0 we will follow the jquery convention with
>> "preventDefault" initially set to false.
>>
>> @Martin:
>> Shouldn't ARA#eventPropagation set to BUBBLE initially? That would be
>> consistent with jquery too.
>
> This is how it was in 6.7.0 and there were two users complaining about the
> changed behavior, so we reverted it in 6.8.0 to what it was till 6.6.0.
> Do others think that bubble should be the default ?
>
>
>
>>
>> Sven
>>
>>
>> On 05/22/2013 03:34 PM, Nick Pratt wrote:
>>
>>> Hi Martin
>>>
>>> I didnt mean to imply that we should change the functionality, just that I
>>> think we should follow the convention of whatever jquery/JS do, except in
>>> the cases where components need to alter this behavior for their correct
>>> functionality. So if the JS/jquery default is to allow event propagation,
>>> then Wicket should default to this same behavior, except where noted.
>>>
>>> N
>>>
>>>
>>> On Wed, May 22, 2013 at 8:44 AM, Martin Grigorov <mgrigorov@apache.org
>>>> wrote:
>>>   Hi Nick,
>>>>
>>>> On Wed, May 22, 2013 at 3:30 PM, Nick Pratt <nb...@gmail.com> wrote:
>>>>
>>>>   With regards to the default setting of this value, I think we should
>>>> follow
>>>>
>>>>> whatever jquery / JS does by default (I dont know whether this is the
>>>>>
>>>> case
>>>>
>>>>> or not). I think events propagate by default, so any provided components
>>>>> that need to alter this behavior should explicitly set (false) for this
>>>>> value.
>>>>>
>>>>>   We need to prevent the default for AjaxFallback** components because
>>>> otherwise both the Ajax and the non-Ajax behaviors will be executed.
>>>>
>>>> We need to stop the propagation of the event by default because otherwise
>>>> you may get more than one Ajax calls when you click on a link which is
>>>> inside a div which also has listener for 'click' (WICKET-5093).
>>>>
>>>>
>>>>
>>>>
>>>>


Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, May 22, 2013 at 4:41 PM, Sven Meier <sv...@meiers.net> wrote:

> With Wicket 7.0.0 we will follow the jquery convention with
> "preventDefault" initially set to false.
>
> @Martin:
> Shouldn't ARA#eventPropagation set to BUBBLE initially? That would be
> consistent with jquery too.


This is how it was in 6.7.0 and there were two users complaining about the
changed behavior, so we reverted it in 6.8.0 to what it was till 6.6.0.
Do others think that bubble should be the default ?



>
>
> Sven
>
>
> On 05/22/2013 03:34 PM, Nick Pratt wrote:
>
>> Hi Martin
>>
>> I didnt mean to imply that we should change the functionality, just that I
>> think we should follow the convention of whatever jquery/JS do, except in
>> the cases where components need to alter this behavior for their correct
>> functionality. So if the JS/jquery default is to allow event propagation,
>> then Wicket should default to this same behavior, except where noted.
>>
>> N
>>
>>
>> On Wed, May 22, 2013 at 8:44 AM, Martin Grigorov <mgrigorov@apache.org
>> >wrote:
>>
>>  Hi Nick,
>>>
>>>
>>> On Wed, May 22, 2013 at 3:30 PM, Nick Pratt <nb...@gmail.com> wrote:
>>>
>>>  With regards to the default setting of this value, I think we should
>>>>
>>> follow
>>>
>>>> whatever jquery / JS does by default (I dont know whether this is the
>>>>
>>> case
>>>
>>>> or not). I think events propagate by default, so any provided components
>>>> that need to alter this behavior should explicitly set (false) for this
>>>> value.
>>>>
>>>>  We need to prevent the default for AjaxFallback** components because
>>> otherwise both the Ajax and the non-Ajax behaviors will be executed.
>>>
>>> We need to stop the propagation of the event by default because otherwise
>>> you may get more than one Ajax calls when you click on a link which is
>>> inside a div which also has listener for 'click' (WICKET-5093).
>>>
>>>
>>>
>>>
>>>
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Sven Meier <sv...@meiers.net>.
With Wicket 7.0.0 we will follow the jquery convention with 
"preventDefault" initially set to false.

@Martin:
Shouldn't ARA#eventPropagation set to BUBBLE initially? That would be 
consistent with jquery too.

Sven

On 05/22/2013 03:34 PM, Nick Pratt wrote:
> Hi Martin
>
> I didnt mean to imply that we should change the functionality, just that I
> think we should follow the convention of whatever jquery/JS do, except in
> the cases where components need to alter this behavior for their correct
> functionality. So if the JS/jquery default is to allow event propagation,
> then Wicket should default to this same behavior, except where noted.
>
> N
>
>
> On Wed, May 22, 2013 at 8:44 AM, Martin Grigorov <mg...@apache.org>wrote:
>
>> Hi Nick,
>>
>>
>> On Wed, May 22, 2013 at 3:30 PM, Nick Pratt <nb...@gmail.com> wrote:
>>
>>> With regards to the default setting of this value, I think we should
>> follow
>>> whatever jquery / JS does by default (I dont know whether this is the
>> case
>>> or not). I think events propagate by default, so any provided components
>>> that need to alter this behavior should explicitly set (false) for this
>>> value.
>>>
>> We need to prevent the default for AjaxFallback** components because
>> otherwise both the Ajax and the non-Ajax behaviors will be executed.
>>
>> We need to stop the propagation of the event by default because otherwise
>> you may get more than one Ajax calls when you click on a link which is
>> inside a div which also has listener for 'click' (WICKET-5093).
>>
>>
>>
>>


Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Nick Pratt <nb...@gmail.com>.
Hi Martin

I didnt mean to imply that we should change the functionality, just that I
think we should follow the convention of whatever jquery/JS do, except in
the cases where components need to alter this behavior for their correct
functionality. So if the JS/jquery default is to allow event propagation,
then Wicket should default to this same behavior, except where noted.

N


On Wed, May 22, 2013 at 8:44 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi Nick,
>
>
> On Wed, May 22, 2013 at 3:30 PM, Nick Pratt <nb...@gmail.com> wrote:
>
> > With regards to the default setting of this value, I think we should
> follow
> > whatever jquery / JS does by default (I dont know whether this is the
> case
> > or not). I think events propagate by default, so any provided components
> > that need to alter this behavior should explicitly set (false) for this
> > value.
> >
>
> We need to prevent the default for AjaxFallback** components because
> otherwise both the Ajax and the non-Ajax behaviors will be executed.
>
> We need to stop the propagation of the event by default because otherwise
> you may get more than one Ajax calls when you click on a link which is
> inside a div which also has listener for 'click' (WICKET-5093).
>
>
>
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
Hi Nick,


On Wed, May 22, 2013 at 3:30 PM, Nick Pratt <nb...@gmail.com> wrote:

> With regards to the default setting of this value, I think we should follow
> whatever jquery / JS does by default (I dont know whether this is the case
> or not). I think events propagate by default, so any provided components
> that need to alter this behavior should explicitly set (false) for this
> value.
>

We need to prevent the default for AjaxFallback** components because
otherwise both the Ajax and the non-Ajax behaviors will be executed.

We need to stop the propagation of the event by default because otherwise
you may get more than one Ajax calls when you click on a link which is
inside a div which also has listener for 'click' (WICKET-5093).


>
> N
>
>
> On Wed, May 22, 2013 at 7:14 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > On Wed, May 22, 2013 at 1:46 PM, Sven Meier <sv...@meiers.net> wrote:
> >
> > > I still think we can change the default value for 'allowDefault' to
> true.
> > >> Can you think of a bad scenario when this will break ?
> > >>
> > >
> > > I'm not sure, but it will surely break somewhere.
> > >
> > > For 6.x I'd just restore AjaxFormValidatingBehavior's functionality
> with
> > > allowDefault=true iff a throttle is given. This could be done in
> 6.9.0, a
> > > workaround for 6.8.0 exists by copying the #addToAllFormComponents()
> > method.
> > >
> > > All developers using throttlingSettings in their own behaviors will
> have
> > > to set allowDefault=true for themselves to restore the old behavior.
> > >
> > > For 7.0.0 we could rename the setting to "preventDefault" (as in
> jquery)
> > > with "false" as default value.
> > >
> >
> > There was a reason why I named it 'allowDefault' but I don't remember it
> > now.
> > I'll make a ticket for 7.0.0
> >
> >
> > >
> > > Sven
> > >
> > >
> > >
> > >
> > > On 05/22/2013 12:30 PM, Martin Grigorov wrote:
> > >
> > >> Ouch!
> > >> You are correct!
> > >> It is the same behavior in 6.7.0 and 6.6.0.
> > >> So, I agree that there is no need of 6.8.1.
> > >>
> > >>
> > >> I still think we can change the default value for 'allowDefault' to
> > true.
> > >> Can you think of a bad scenario when this will break ?
> > >> Since there are no user complaints I'm not keen to do the change
> neither
> > >> in
> > >> 6.x nor in 7.0.0 but I think the change is a good improvement.
> > >>
> > >>
> > >> On Wed, May 22, 2013 at 1:11 PM, Sven Meier <sv...@meiers.net> wrote:
> > >>
> > >>  It's been that way ever since:
> > >>>
> > >>> "keydown" with allowDefault=false -> not character input
> > >>>
> > >>> Sven
> > >>>
> > >>>
> > >>> On 05/22/2013 12:07 PM, Martin Grigorov wrote:
> > >>>
> > >>>  The quickstart in the ticket is very simple, there is no usage of
> > >>>> throttling.
> > >>>> It's just:
> > >>>>
> > >>>> textField.add(new AjaxEventBehavior("keydown") {
> > >>>>    @Override
> > >>>> protected void onEvent(AjaxRequestTarget target) {
> > >>>> System.err.println("event");
> > >>>>    }
> > >>>> });
> > >>>>
> > >>>> Without explicitly allowing the default behavior the user cannot
> > enter a
> > >>>> single character in the <input type=text>.
> > >>>>
> > >>>>
> > >>>> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net>
> wrote:
> > >>>>
> > >>>>   AFAICS this is a problem only for behaviors which are throttled.
> > >>>>
> > >>>>> AjaxFormValidatingBehavior is the only one in Wicket, we can simple
> > set
> > >>>>> allowDefault=true for that one. And I don't think this is so urgent
> > to
> > >>>>> require a 6.8.1 release.
> > >>>>>
> > >>>>> Anyone else using ThrottlingSettings can easily set
> allowDefault=true
> > >>>>> in
> > >>>>> their own behavior.
> > >>>>>
> > >>>>> Changing the default for allowDefault might break many other places
> > in
> > >>>>> user's code :(.
> > >>>>>
> > >>>>> Sven
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
> > >>>>>
> > >>>>>   Hi,
> > >>>>>
> > >>>>>> I think we need 6.8.1 because of the problem in
> > >>>>>> https://issues.apache.org/******jira/browse/WICKET-5194<
> > https://issues.apache.org/****jira/browse/WICKET-5194>
> > >>>>>> <https:**//issues.apache.org/**jira/**browse/WICKET-5194<
> > https://issues.apache.org/**jira/browse/WICKET-5194>
> > >>>>>> >
> > >>>>>> <https:**//issues.apache.org/**jira/**browse/WICKET-5194<
> > http://issues.apache.org/jira/**browse/WICKET-5194>
> > >>>>>> <http**s://issues.apache.org/jira/**browse/WICKET-5194<
> > https://issues.apache.org/jira/browse/WICKET-5194>
> > >>>>>> >
> > >>>>>>
> > >>>>>> .
> > >>>>>> The quickstart shows that textField.add(new
> > >>>>>> AjaxEventBehavior("keydown"))
> > >>>>>> doesn't work because the event' default behavior is prevented.
> > >>>>>>
> > >>>>>> org.apache.wicket.ajax.******attributes.******
> > >>>>>> AjaxRequestAttributes#**
> > >>>>>>
> > >>>>>>
> > >>>>>> allowDefault
> > >>>>>> default value was 'false' since 6.0.0 but it seems it was not used
> > at
> > >>>>>> all
> > >>>>>> in many cases before the changes in WICKET-5093:
> > >>>>>>
> > >>>>>> https://git-wip-us.apache.org/******repos/asf/wicket/repo?p=**<
> > https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**>
> > >>>>>> **<https://git-wip-us.apache.
> **org/**repos/asf/wicket/repo?p=****<
> > https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
> > >>>>>> >
> > >>>>>> wicket.git;a=commitdiff;h=******a11ce8a7e3b575385d8f03db621305****
> > >>>>>> **17a2b80d09<https://git-wip-****us.apache.org/repos/asf/**
> > >>>>>> wicket/repo?p=wicket.git;a=****commitdiff;h=**
> > >>>>>>
> > >>>>>> a11ce8a7e3b575385d8f03db621305****17a2b80d09<https://git-wip-**
> > >>>>>>
> > us.apache.org/repos/asf/**wicket/repo?p=wicket.git;a=**commitdiff;h=*
> > >>>>>> *a11ce8a7e3b575385d8f03db621305**17a2b80d09<
> >
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09
> > >
> > >>>>>> >
> > >>>>>> https://git-wip-us.apache.org/******repos/asf/wicket/repo?p=**<
> > https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**>
> > >>>>>> **<https://git-wip-us.apache.
> **org/**repos/asf/wicket/repo?p=****<
> > https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
> > >>>>>> >
> > >>>>>> wicket.git;a=commitdiff;h=******6eec04b135a60c31fac7b74b866d9f****
> > >>>>>> **dcc862ef30<https://git-wip-****us.apache.org/repos/asf/**
> > >>>>>> wicket/repo?p=wicket.git;a=****commitdiff;h=**
> > >>>>>>
> > >>>>>> 6eec04b135a60c31fac7b74b866d9f****dcc862ef30<https://git-wip-**
> > >>>>>>
> > us.apache.org/repos/asf/**wicket/repo?p=wicket.git;a=**commitdiff;h=*
> > >>>>>> *6eec04b135a60c31fac7b74b866d9f**dcc862ef30<
> >
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30
> > >
> > >>>>>> >
> > >>>>>>
> > >>>>>> I suggest to change the default value of 'allowDefault' to 'true'.
> > >>>>>>
> > >>>>>> Do you see any use cases where the value should be 'false' ?
> > >>>>>> The 'false' value was because AjaxFallbackLink should not execute
> it
> > >>>>>> default behavior - following its href location. But here really
> the
> > >>>>>> effective JS event property is 'stopPropagation' which has been
> > >>>>>> extracted
> > >>>>>> to its own property in AjaxRequestAttributes.
> > >>>>>>
> > >>>>>> A workaround is to use:
> > >>>>>>
> > >>>>>> getAjaxRequestTargetListeners(******).add(new AjaxRequestTarget.**
> > >>>>>> AbstractListener()
> > >>>>>> {
> > >>>>>>     @Override
> > >>>>>> public void updateAjaxAttributes(******AjaxRequestAttributes
> > >>>>>> attributes)
> > >>>>>> {
> > >>>>>>     super.updateAjaxAttributes(******attributes);
> > >>>>>>
> > >>>>>> attributes.setAllowDefault(******true);
> > >>>>>>
> > >>>>>>
> > >>>>>> }
> > >>>>>>     });
> > >>>>>>
> > >>>>>> in YourApp#init(). But we cannot ask all users to do this until
> > 6.9.0
> > >>>>>> is
> > >>>>>> released.
> > >>>>>>
> > >>>>>> What do you think ? Should we fix this and release 6.8.1 as soon
> as
> > >>>>>> possible ?
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >
> >
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Nick Pratt <nb...@gmail.com>.
With regards to the default setting of this value, I think we should follow
whatever jquery / JS does by default (I dont know whether this is the case
or not). I think events propagate by default, so any provided components
that need to alter this behavior should explicitly set (false) for this
value.

N


On Wed, May 22, 2013 at 7:14 AM, Martin Grigorov <mg...@apache.org>wrote:

> On Wed, May 22, 2013 at 1:46 PM, Sven Meier <sv...@meiers.net> wrote:
>
> > I still think we can change the default value for 'allowDefault' to true.
> >> Can you think of a bad scenario when this will break ?
> >>
> >
> > I'm not sure, but it will surely break somewhere.
> >
> > For 6.x I'd just restore AjaxFormValidatingBehavior's functionality with
> > allowDefault=true iff a throttle is given. This could be done in 6.9.0, a
> > workaround for 6.8.0 exists by copying the #addToAllFormComponents()
> method.
> >
> > All developers using throttlingSettings in their own behaviors will have
> > to set allowDefault=true for themselves to restore the old behavior.
> >
> > For 7.0.0 we could rename the setting to "preventDefault" (as in jquery)
> > with "false" as default value.
> >
>
> There was a reason why I named it 'allowDefault' but I don't remember it
> now.
> I'll make a ticket for 7.0.0
>
>
> >
> > Sven
> >
> >
> >
> >
> > On 05/22/2013 12:30 PM, Martin Grigorov wrote:
> >
> >> Ouch!
> >> You are correct!
> >> It is the same behavior in 6.7.0 and 6.6.0.
> >> So, I agree that there is no need of 6.8.1.
> >>
> >>
> >> I still think we can change the default value for 'allowDefault' to
> true.
> >> Can you think of a bad scenario when this will break ?
> >> Since there are no user complaints I'm not keen to do the change neither
> >> in
> >> 6.x nor in 7.0.0 but I think the change is a good improvement.
> >>
> >>
> >> On Wed, May 22, 2013 at 1:11 PM, Sven Meier <sv...@meiers.net> wrote:
> >>
> >>  It's been that way ever since:
> >>>
> >>> "keydown" with allowDefault=false -> not character input
> >>>
> >>> Sven
> >>>
> >>>
> >>> On 05/22/2013 12:07 PM, Martin Grigorov wrote:
> >>>
> >>>  The quickstart in the ticket is very simple, there is no usage of
> >>>> throttling.
> >>>> It's just:
> >>>>
> >>>> textField.add(new AjaxEventBehavior("keydown") {
> >>>>    @Override
> >>>> protected void onEvent(AjaxRequestTarget target) {
> >>>> System.err.println("event");
> >>>>    }
> >>>> });
> >>>>
> >>>> Without explicitly allowing the default behavior the user cannot
> enter a
> >>>> single character in the <input type=text>.
> >>>>
> >>>>
> >>>> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:
> >>>>
> >>>>   AFAICS this is a problem only for behaviors which are throttled.
> >>>>
> >>>>> AjaxFormValidatingBehavior is the only one in Wicket, we can simple
> set
> >>>>> allowDefault=true for that one. And I don't think this is so urgent
> to
> >>>>> require a 6.8.1 release.
> >>>>>
> >>>>> Anyone else using ThrottlingSettings can easily set allowDefault=true
> >>>>> in
> >>>>> their own behavior.
> >>>>>
> >>>>> Changing the default for allowDefault might break many other places
> in
> >>>>> user's code :(.
> >>>>>
> >>>>> Sven
> >>>>>
> >>>>>
> >>>>>
> >>>>> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
> >>>>>
> >>>>>   Hi,
> >>>>>
> >>>>>> I think we need 6.8.1 because of the problem in
> >>>>>> https://issues.apache.org/******jira/browse/WICKET-5194<
> https://issues.apache.org/****jira/browse/WICKET-5194>
> >>>>>> <https:**//issues.apache.org/**jira/**browse/WICKET-5194<
> https://issues.apache.org/**jira/browse/WICKET-5194>
> >>>>>> >
> >>>>>> <https:**//issues.apache.org/**jira/**browse/WICKET-5194<
> http://issues.apache.org/jira/**browse/WICKET-5194>
> >>>>>> <http**s://issues.apache.org/jira/**browse/WICKET-5194<
> https://issues.apache.org/jira/browse/WICKET-5194>
> >>>>>> >
> >>>>>>
> >>>>>> .
> >>>>>> The quickstart shows that textField.add(new
> >>>>>> AjaxEventBehavior("keydown"))
> >>>>>> doesn't work because the event' default behavior is prevented.
> >>>>>>
> >>>>>> org.apache.wicket.ajax.******attributes.******
> >>>>>> AjaxRequestAttributes#**
> >>>>>>
> >>>>>>
> >>>>>> allowDefault
> >>>>>> default value was 'false' since 6.0.0 but it seems it was not used
> at
> >>>>>> all
> >>>>>> in many cases before the changes in WICKET-5093:
> >>>>>>
> >>>>>> https://git-wip-us.apache.org/******repos/asf/wicket/repo?p=**<
> https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**>
> >>>>>> **<https://git-wip-us.apache.**org/**repos/asf/wicket/repo?p=****<
> https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
> >>>>>> >
> >>>>>> wicket.git;a=commitdiff;h=******a11ce8a7e3b575385d8f03db621305****
> >>>>>> **17a2b80d09<https://git-wip-****us.apache.org/repos/asf/**
> >>>>>> wicket/repo?p=wicket.git;a=****commitdiff;h=**
> >>>>>>
> >>>>>> a11ce8a7e3b575385d8f03db621305****17a2b80d09<https://git-wip-**
> >>>>>>
> us.apache.org/repos/asf/**wicket/repo?p=wicket.git;a=**commitdiff;h=*
> >>>>>> *a11ce8a7e3b575385d8f03db621305**17a2b80d09<
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09
> >
> >>>>>> >
> >>>>>> https://git-wip-us.apache.org/******repos/asf/wicket/repo?p=**<
> https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**>
> >>>>>> **<https://git-wip-us.apache.**org/**repos/asf/wicket/repo?p=****<
> https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
> >>>>>> >
> >>>>>> wicket.git;a=commitdiff;h=******6eec04b135a60c31fac7b74b866d9f****
> >>>>>> **dcc862ef30<https://git-wip-****us.apache.org/repos/asf/**
> >>>>>> wicket/repo?p=wicket.git;a=****commitdiff;h=**
> >>>>>>
> >>>>>> 6eec04b135a60c31fac7b74b866d9f****dcc862ef30<https://git-wip-**
> >>>>>>
> us.apache.org/repos/asf/**wicket/repo?p=wicket.git;a=**commitdiff;h=*
> >>>>>> *6eec04b135a60c31fac7b74b866d9f**dcc862ef30<
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30
> >
> >>>>>> >
> >>>>>>
> >>>>>> I suggest to change the default value of 'allowDefault' to 'true'.
> >>>>>>
> >>>>>> Do you see any use cases where the value should be 'false' ?
> >>>>>> The 'false' value was because AjaxFallbackLink should not execute it
> >>>>>> default behavior - following its href location. But here really the
> >>>>>> effective JS event property is 'stopPropagation' which has been
> >>>>>> extracted
> >>>>>> to its own property in AjaxRequestAttributes.
> >>>>>>
> >>>>>> A workaround is to use:
> >>>>>>
> >>>>>> getAjaxRequestTargetListeners(******).add(new AjaxRequestTarget.**
> >>>>>> AbstractListener()
> >>>>>> {
> >>>>>>     @Override
> >>>>>> public void updateAjaxAttributes(******AjaxRequestAttributes
> >>>>>> attributes)
> >>>>>> {
> >>>>>>     super.updateAjaxAttributes(******attributes);
> >>>>>>
> >>>>>> attributes.setAllowDefault(******true);
> >>>>>>
> >>>>>>
> >>>>>> }
> >>>>>>     });
> >>>>>>
> >>>>>> in YourApp#init(). But we cannot ask all users to do this until
> 6.9.0
> >>>>>> is
> >>>>>> released.
> >>>>>>
> >>>>>> What do you think ? Should we fix this and release 6.8.1 as soon as
> >>>>>> possible ?
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, May 22, 2013 at 1:46 PM, Sven Meier <sv...@meiers.net> wrote:

> I still think we can change the default value for 'allowDefault' to true.
>> Can you think of a bad scenario when this will break ?
>>
>
> I'm not sure, but it will surely break somewhere.
>
> For 6.x I'd just restore AjaxFormValidatingBehavior's functionality with
> allowDefault=true iff a throttle is given. This could be done in 6.9.0, a
> workaround for 6.8.0 exists by copying the #addToAllFormComponents() method.
>
> All developers using throttlingSettings in their own behaviors will have
> to set allowDefault=true for themselves to restore the old behavior.
>
> For 7.0.0 we could rename the setting to "preventDefault" (as in jquery)
> with "false" as default value.
>

There was a reason why I named it 'allowDefault' but I don't remember it
now.
I'll make a ticket for 7.0.0


>
> Sven
>
>
>
>
> On 05/22/2013 12:30 PM, Martin Grigorov wrote:
>
>> Ouch!
>> You are correct!
>> It is the same behavior in 6.7.0 and 6.6.0.
>> So, I agree that there is no need of 6.8.1.
>>
>>
>> I still think we can change the default value for 'allowDefault' to true.
>> Can you think of a bad scenario when this will break ?
>> Since there are no user complaints I'm not keen to do the change neither
>> in
>> 6.x nor in 7.0.0 but I think the change is a good improvement.
>>
>>
>> On Wed, May 22, 2013 at 1:11 PM, Sven Meier <sv...@meiers.net> wrote:
>>
>>  It's been that way ever since:
>>>
>>> "keydown" with allowDefault=false -> not character input
>>>
>>> Sven
>>>
>>>
>>> On 05/22/2013 12:07 PM, Martin Grigorov wrote:
>>>
>>>  The quickstart in the ticket is very simple, there is no usage of
>>>> throttling.
>>>> It's just:
>>>>
>>>> textField.add(new AjaxEventBehavior("keydown") {
>>>>    @Override
>>>> protected void onEvent(AjaxRequestTarget target) {
>>>> System.err.println("event");
>>>>    }
>>>> });
>>>>
>>>> Without explicitly allowing the default behavior the user cannot enter a
>>>> single character in the <input type=text>.
>>>>
>>>>
>>>> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:
>>>>
>>>>   AFAICS this is a problem only for behaviors which are throttled.
>>>>
>>>>> AjaxFormValidatingBehavior is the only one in Wicket, we can simple set
>>>>> allowDefault=true for that one. And I don't think this is so urgent to
>>>>> require a 6.8.1 release.
>>>>>
>>>>> Anyone else using ThrottlingSettings can easily set allowDefault=true
>>>>> in
>>>>> their own behavior.
>>>>>
>>>>> Changing the default for allowDefault might break many other places in
>>>>> user's code :(.
>>>>>
>>>>> Sven
>>>>>
>>>>>
>>>>>
>>>>> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
>>>>>
>>>>>   Hi,
>>>>>
>>>>>> I think we need 6.8.1 because of the problem in
>>>>>> https://issues.apache.org/******jira/browse/WICKET-5194<https://issues.apache.org/****jira/browse/WICKET-5194>
>>>>>> <https:**//issues.apache.org/**jira/**browse/WICKET-5194<https://issues.apache.org/**jira/browse/WICKET-5194>
>>>>>> >
>>>>>> <https:**//issues.apache.org/**jira/**browse/WICKET-5194<http://issues.apache.org/jira/**browse/WICKET-5194>
>>>>>> <http**s://issues.apache.org/jira/**browse/WICKET-5194<https://issues.apache.org/jira/browse/WICKET-5194>
>>>>>> >
>>>>>>
>>>>>> .
>>>>>> The quickstart shows that textField.add(new
>>>>>> AjaxEventBehavior("keydown"))
>>>>>> doesn't work because the event' default behavior is prevented.
>>>>>>
>>>>>> org.apache.wicket.ajax.******attributes.******
>>>>>> AjaxRequestAttributes#**
>>>>>>
>>>>>>
>>>>>> allowDefault
>>>>>> default value was 'false' since 6.0.0 but it seems it was not used at
>>>>>> all
>>>>>> in many cases before the changes in WICKET-5093:
>>>>>>
>>>>>> https://git-wip-us.apache.org/******repos/asf/wicket/repo?p=**<https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**>
>>>>>> **<https://git-wip-us.apache.**org/**repos/asf/wicket/repo?p=****<https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
>>>>>> >
>>>>>> wicket.git;a=commitdiff;h=******a11ce8a7e3b575385d8f03db621305****
>>>>>> **17a2b80d09<https://git-wip-****us.apache.org/repos/asf/**
>>>>>> wicket/repo?p=wicket.git;a=****commitdiff;h=**
>>>>>>
>>>>>> a11ce8a7e3b575385d8f03db621305****17a2b80d09<https://git-wip-**
>>>>>> us.apache.org/repos/asf/**wicket/repo?p=wicket.git;a=**commitdiff;h=*
>>>>>> *a11ce8a7e3b575385d8f03db621305**17a2b80d09<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09>
>>>>>> >
>>>>>> https://git-wip-us.apache.org/******repos/asf/wicket/repo?p=**<https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**>
>>>>>> **<https://git-wip-us.apache.**org/**repos/asf/wicket/repo?p=****<https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
>>>>>> >
>>>>>> wicket.git;a=commitdiff;h=******6eec04b135a60c31fac7b74b866d9f****
>>>>>> **dcc862ef30<https://git-wip-****us.apache.org/repos/asf/**
>>>>>> wicket/repo?p=wicket.git;a=****commitdiff;h=**
>>>>>>
>>>>>> 6eec04b135a60c31fac7b74b866d9f****dcc862ef30<https://git-wip-**
>>>>>> us.apache.org/repos/asf/**wicket/repo?p=wicket.git;a=**commitdiff;h=*
>>>>>> *6eec04b135a60c31fac7b74b866d9f**dcc862ef30<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30>
>>>>>> >
>>>>>>
>>>>>> I suggest to change the default value of 'allowDefault' to 'true'.
>>>>>>
>>>>>> Do you see any use cases where the value should be 'false' ?
>>>>>> The 'false' value was because AjaxFallbackLink should not execute it
>>>>>> default behavior - following its href location. But here really the
>>>>>> effective JS event property is 'stopPropagation' which has been
>>>>>> extracted
>>>>>> to its own property in AjaxRequestAttributes.
>>>>>>
>>>>>> A workaround is to use:
>>>>>>
>>>>>> getAjaxRequestTargetListeners(******).add(new AjaxRequestTarget.**
>>>>>> AbstractListener()
>>>>>> {
>>>>>>     @Override
>>>>>> public void updateAjaxAttributes(******AjaxRequestAttributes
>>>>>> attributes)
>>>>>> {
>>>>>>     super.updateAjaxAttributes(******attributes);
>>>>>>
>>>>>> attributes.setAllowDefault(******true);
>>>>>>
>>>>>>
>>>>>> }
>>>>>>     });
>>>>>>
>>>>>> in YourApp#init(). But we cannot ask all users to do this until 6.9.0
>>>>>> is
>>>>>> released.
>>>>>>
>>>>>> What do you think ? Should we fix this and release 6.8.1 as soon as
>>>>>> possible ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Sven Meier <sv...@meiers.net>.
>I still think we can change the default value for 'allowDefault' to true.
>Can you think of a bad scenario when this will break ?

I'm not sure, but it will surely break somewhere.

For 6.x I'd just restore AjaxFormValidatingBehavior's functionality with allowDefault=true iff a throttle is given. This could be done in 6.9.0, a workaround for 6.8.0 exists by copying the #addToAllFormComponents() method.

All developers using throttlingSettings in their own behaviors will have to set allowDefault=true for themselves to restore the old behavior.

For 7.0.0 we could rename the setting to "preventDefault" (as in jquery) with "false" as default value.

Sven



On 05/22/2013 12:30 PM, Martin Grigorov wrote:
> Ouch!
> You are correct!
> It is the same behavior in 6.7.0 and 6.6.0.
> So, I agree that there is no need of 6.8.1.
>
>
> I still think we can change the default value for 'allowDefault' to true.
> Can you think of a bad scenario when this will break ?
> Since there are no user complaints I'm not keen to do the change neither in
> 6.x nor in 7.0.0 but I think the change is a good improvement.
>
>
> On Wed, May 22, 2013 at 1:11 PM, Sven Meier <sv...@meiers.net> wrote:
>
>> It's been that way ever since:
>>
>> "keydown" with allowDefault=false -> not character input
>>
>> Sven
>>
>>
>> On 05/22/2013 12:07 PM, Martin Grigorov wrote:
>>
>>> The quickstart in the ticket is very simple, there is no usage of
>>> throttling.
>>> It's just:
>>>
>>> textField.add(new AjaxEventBehavior("keydown") {
>>>    @Override
>>> protected void onEvent(AjaxRequestTarget target) {
>>> System.err.println("event");
>>>    }
>>> });
>>>
>>> Without explicitly allowing the default behavior the user cannot enter a
>>> single character in the <input type=text>.
>>>
>>>
>>> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:
>>>
>>>   AFAICS this is a problem only for behaviors which are throttled.
>>>> AjaxFormValidatingBehavior is the only one in Wicket, we can simple set
>>>> allowDefault=true for that one. And I don't think this is so urgent to
>>>> require a 6.8.1 release.
>>>>
>>>> Anyone else using ThrottlingSettings can easily set allowDefault=true in
>>>> their own behavior.
>>>>
>>>> Changing the default for allowDefault might break many other places in
>>>> user's code :(.
>>>>
>>>> Sven
>>>>
>>>>
>>>>
>>>> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
>>>>
>>>>   Hi,
>>>>> I think we need 6.8.1 because of the problem in
>>>>> https://issues.apache.org/****jira/browse/WICKET-5194<https://issues.apache.org/**jira/browse/WICKET-5194>
>>>>> <https:**//issues.apache.org/jira/**browse/WICKET-5194<https://issues.apache.org/jira/browse/WICKET-5194>
>>>>> .
>>>>> The quickstart shows that textField.add(new
>>>>> AjaxEventBehavior("keydown"))
>>>>> doesn't work because the event' default behavior is prevented.
>>>>>
>>>>> org.apache.wicket.ajax.****attributes.****AjaxRequestAttributes#**
>>>>>
>>>>> allowDefault
>>>>> default value was 'false' since 6.0.0 but it seems it was not used at
>>>>> all
>>>>> in many cases before the changes in WICKET-5093:
>>>>>
>>>>> https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**<https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
>>>>> wicket.git;a=commitdiff;h=****a11ce8a7e3b575385d8f03db621305**
>>>>> **17a2b80d09<https://git-wip-**us.apache.org/repos/asf/**
>>>>> wicket/repo?p=wicket.git;a=**commitdiff;h=**
>>>>> a11ce8a7e3b575385d8f03db621305**17a2b80d09<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09>
>>>>> https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**<https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
>>>>> wicket.git;a=commitdiff;h=****6eec04b135a60c31fac7b74b866d9f**
>>>>> **dcc862ef30<https://git-wip-**us.apache.org/repos/asf/**
>>>>> wicket/repo?p=wicket.git;a=**commitdiff;h=**
>>>>> 6eec04b135a60c31fac7b74b866d9f**dcc862ef30<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30>
>>>>>
>>>>> I suggest to change the default value of 'allowDefault' to 'true'.
>>>>>
>>>>> Do you see any use cases where the value should be 'false' ?
>>>>> The 'false' value was because AjaxFallbackLink should not execute it
>>>>> default behavior - following its href location. But here really the
>>>>> effective JS event property is 'stopPropagation' which has been
>>>>> extracted
>>>>> to its own property in AjaxRequestAttributes.
>>>>>
>>>>> A workaround is to use:
>>>>>
>>>>> getAjaxRequestTargetListeners(****).add(new AjaxRequestTarget.**
>>>>> AbstractListener()
>>>>> {
>>>>>     @Override
>>>>> public void updateAjaxAttributes(****AjaxRequestAttributes attributes)
>>>>> {
>>>>>     super.updateAjaxAttributes(****attributes);
>>>>>
>>>>> attributes.setAllowDefault(****true);
>>>>>
>>>>> }
>>>>>     });
>>>>>
>>>>> in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
>>>>> released.
>>>>>
>>>>> What do you think ? Should we fix this and release 6.8.1 as soon as
>>>>> possible ?
>>>>>
>>>>>
>>>>>


Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
Ouch!
You are correct!
It is the same behavior in 6.7.0 and 6.6.0.
So, I agree that there is no need of 6.8.1.


I still think we can change the default value for 'allowDefault' to true.
Can you think of a bad scenario when this will break ?
Since there are no user complaints I'm not keen to do the change neither in
6.x nor in 7.0.0 but I think the change is a good improvement.


On Wed, May 22, 2013 at 1:11 PM, Sven Meier <sv...@meiers.net> wrote:

> It's been that way ever since:
>
> "keydown" with allowDefault=false -> not character input
>
> Sven
>
>
> On 05/22/2013 12:07 PM, Martin Grigorov wrote:
>
>> The quickstart in the ticket is very simple, there is no usage of
>> throttling.
>> It's just:
>>
>> textField.add(new AjaxEventBehavior("keydown") {
>>   @Override
>> protected void onEvent(AjaxRequestTarget target) {
>> System.err.println("event");
>>   }
>> });
>>
>> Without explicitly allowing the default behavior the user cannot enter a
>> single character in the <input type=text>.
>>
>>
>> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:
>>
>>  AFAICS this is a problem only for behaviors which are throttled.
>>> AjaxFormValidatingBehavior is the only one in Wicket, we can simple set
>>> allowDefault=true for that one. And I don't think this is so urgent to
>>> require a 6.8.1 release.
>>>
>>> Anyone else using ThrottlingSettings can easily set allowDefault=true in
>>> their own behavior.
>>>
>>> Changing the default for allowDefault might break many other places in
>>> user's code :(.
>>>
>>> Sven
>>>
>>>
>>>
>>> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
>>>
>>>  Hi,
>>>>
>>>> I think we need 6.8.1 because of the problem in
>>>> https://issues.apache.org/****jira/browse/WICKET-5194<https://issues.apache.org/**jira/browse/WICKET-5194>
>>>> <https:**//issues.apache.org/jira/**browse/WICKET-5194<https://issues.apache.org/jira/browse/WICKET-5194>
>>>> >
>>>>
>>>> .
>>>> The quickstart shows that textField.add(new
>>>> AjaxEventBehavior("keydown"))
>>>> doesn't work because the event' default behavior is prevented.
>>>>
>>>> org.apache.wicket.ajax.****attributes.****AjaxRequestAttributes#**
>>>>
>>>> allowDefault
>>>> default value was 'false' since 6.0.0 but it seems it was not used at
>>>> all
>>>> in many cases before the changes in WICKET-5093:
>>>>
>>>> https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**<https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
>>>> wicket.git;a=commitdiff;h=****a11ce8a7e3b575385d8f03db621305**
>>>> **17a2b80d09<https://git-wip-**us.apache.org/repos/asf/**
>>>> wicket/repo?p=wicket.git;a=**commitdiff;h=**
>>>> a11ce8a7e3b575385d8f03db621305**17a2b80d09<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09>
>>>> >
>>>> https://git-wip-us.apache.org/****repos/asf/wicket/repo?p=**<https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**>
>>>> wicket.git;a=commitdiff;h=****6eec04b135a60c31fac7b74b866d9f**
>>>> **dcc862ef30<https://git-wip-**us.apache.org/repos/asf/**
>>>> wicket/repo?p=wicket.git;a=**commitdiff;h=**
>>>> 6eec04b135a60c31fac7b74b866d9f**dcc862ef30<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30>
>>>> >
>>>>
>>>>
>>>> I suggest to change the default value of 'allowDefault' to 'true'.
>>>>
>>>> Do you see any use cases where the value should be 'false' ?
>>>> The 'false' value was because AjaxFallbackLink should not execute it
>>>> default behavior - following its href location. But here really the
>>>> effective JS event property is 'stopPropagation' which has been
>>>> extracted
>>>> to its own property in AjaxRequestAttributes.
>>>>
>>>> A workaround is to use:
>>>>
>>>> getAjaxRequestTargetListeners(****).add(new AjaxRequestTarget.**
>>>> AbstractListener()
>>>> {
>>>>    @Override
>>>> public void updateAjaxAttributes(****AjaxRequestAttributes attributes)
>>>> {
>>>>    super.updateAjaxAttributes(****attributes);
>>>>
>>>> attributes.setAllowDefault(****true);
>>>>
>>>> }
>>>>    });
>>>>
>>>> in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
>>>> released.
>>>>
>>>> What do you think ? Should we fix this and release 6.8.1 as soon as
>>>> possible ?
>>>>
>>>>
>>>>
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Sven Meier <sv...@meiers.net>.
It's been that way ever since:

"keydown" with allowDefault=false -> not character input

Sven

On 05/22/2013 12:07 PM, Martin Grigorov wrote:
> The quickstart in the ticket is very simple, there is no usage of
> throttling.
> It's just:
>
> textField.add(new AjaxEventBehavior("keydown") {
>   @Override
> protected void onEvent(AjaxRequestTarget target) {
> System.err.println("event");
>   }
> });
>
> Without explicitly allowing the default behavior the user cannot enter a
> single character in the <input type=text>.
>
>
> On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:
>
>> AFAICS this is a problem only for behaviors which are throttled.
>> AjaxFormValidatingBehavior is the only one in Wicket, we can simple set
>> allowDefault=true for that one. And I don't think this is so urgent to
>> require a 6.8.1 release.
>>
>> Anyone else using ThrottlingSettings can easily set allowDefault=true in
>> their own behavior.
>>
>> Changing the default for allowDefault might break many other places in
>> user's code :(.
>>
>> Sven
>>
>>
>>
>> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
>>
>>> Hi,
>>>
>>> I think we need 6.8.1 because of the problem in
>>> https://issues.apache.org/**jira/browse/WICKET-5194<https://issues.apache.org/jira/browse/WICKET-5194>
>>> .
>>> The quickstart shows that textField.add(new AjaxEventBehavior("keydown"))
>>> doesn't work because the event' default behavior is prevented.
>>>
>>> org.apache.wicket.ajax.**attributes.**AjaxRequestAttributes#**
>>> allowDefault
>>> default value was 'false' since 6.0.0 but it seems it was not used at all
>>> in many cases before the changes in WICKET-5093:
>>>
>>> https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**
>>> wicket.git;a=commitdiff;h=**a11ce8a7e3b575385d8f03db621305**17a2b80d09<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09>
>>> https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**
>>> wicket.git;a=commitdiff;h=**6eec04b135a60c31fac7b74b866d9f**dcc862ef30<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30>
>>>
>>> I suggest to change the default value of 'allowDefault' to 'true'.
>>>
>>> Do you see any use cases where the value should be 'false' ?
>>> The 'false' value was because AjaxFallbackLink should not execute it
>>> default behavior - following its href location. But here really the
>>> effective JS event property is 'stopPropagation' which has been extracted
>>> to its own property in AjaxRequestAttributes.
>>>
>>> A workaround is to use:
>>>
>>> getAjaxRequestTargetListeners(**).add(new AjaxRequestTarget.**
>>> AbstractListener()
>>> {
>>>    @Override
>>> public void updateAjaxAttributes(**AjaxRequestAttributes attributes)
>>> {
>>>    super.updateAjaxAttributes(**attributes);
>>>
>>> attributes.setAllowDefault(**true);
>>> }
>>>    });
>>>
>>> in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
>>> released.
>>>
>>> What do you think ? Should we fix this and release 6.8.1 as soon as
>>> possible ?
>>>
>>>


Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
The quickstart in the ticket is very simple, there is no usage of
throttling.
It's just:

textField.add(new AjaxEventBehavior("keydown") {
 @Override
protected void onEvent(AjaxRequestTarget target) {
System.err.println("event");
 }
});

Without explicitly allowing the default behavior the user cannot enter a
single character in the <input type=text>.


On Wed, May 22, 2013 at 1:01 PM, Sven Meier <sv...@meiers.net> wrote:

> AFAICS this is a problem only for behaviors which are throttled.
> AjaxFormValidatingBehavior is the only one in Wicket, we can simple set
> allowDefault=true for that one. And I don't think this is so urgent to
> require a 6.8.1 release.
>
> Anyone else using ThrottlingSettings can easily set allowDefault=true in
> their own behavior.
>
> Changing the default for allowDefault might break many other places in
> user's code :(.
>
> Sven
>
>
>
> On 05/22/2013 09:04 AM, Martin Grigorov wrote:
>
>> Hi,
>>
>> I think we need 6.8.1 because of the problem in
>> https://issues.apache.org/**jira/browse/WICKET-5194<https://issues.apache.org/jira/browse/WICKET-5194>
>> .
>> The quickstart shows that textField.add(new AjaxEventBehavior("keydown"))
>> doesn't work because the event' default behavior is prevented.
>>
>> org.apache.wicket.ajax.**attributes.**AjaxRequestAttributes#**
>> allowDefault
>> default value was 'false' since 6.0.0 but it seems it was not used at all
>> in many cases before the changes in WICKET-5093:
>>
>> https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**
>> wicket.git;a=commitdiff;h=**a11ce8a7e3b575385d8f03db621305**17a2b80d09<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09>
>> https://git-wip-us.apache.org/**repos/asf/wicket/repo?p=**
>> wicket.git;a=commitdiff;h=**6eec04b135a60c31fac7b74b866d9f**dcc862ef30<https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30>
>>
>> I suggest to change the default value of 'allowDefault' to 'true'.
>>
>> Do you see any use cases where the value should be 'false' ?
>> The 'false' value was because AjaxFallbackLink should not execute it
>> default behavior - following its href location. But here really the
>> effective JS event property is 'stopPropagation' which has been extracted
>> to its own property in AjaxRequestAttributes.
>>
>> A workaround is to use:
>>
>> getAjaxRequestTargetListeners(**).add(new AjaxRequestTarget.**
>> AbstractListener()
>> {
>>   @Override
>> public void updateAjaxAttributes(**AjaxRequestAttributes attributes)
>> {
>>   super.updateAjaxAttributes(**attributes);
>>
>> attributes.setAllowDefault(**true);
>> }
>>   });
>>
>> in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
>> released.
>>
>> What do you think ? Should we fix this and release 6.8.1 as soon as
>> possible ?
>>
>>
>

Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Sven Meier <sv...@meiers.net>.
AFAICS this is a problem only for behaviors which are throttled. 
AjaxFormValidatingBehavior is the only one in Wicket, we can simple set 
allowDefault=true for that one. And I don't think this is so urgent to 
require a 6.8.1 release.

Anyone else using ThrottlingSettings can easily set allowDefault=true in 
their own behavior.

Changing the default for allowDefault might break many other places in 
user's code :(.

Sven


On 05/22/2013 09:04 AM, Martin Grigorov wrote:
> Hi,
>
> I think we need 6.8.1 because of the problem in
> https://issues.apache.org/jira/browse/WICKET-5194.
> The quickstart shows that textField.add(new AjaxEventBehavior("keydown"))
> doesn't work because the event' default behavior is prevented.
>
> org.apache.wicket.ajax.attributes.AjaxRequestAttributes#allowDefault
> default value was 'false' since 6.0.0 but it seems it was not used at all
> in many cases before the changes in WICKET-5093:
>
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30
>
> I suggest to change the default value of 'allowDefault' to 'true'.
>
> Do you see any use cases where the value should be 'false' ?
> The 'false' value was because AjaxFallbackLink should not execute it
> default behavior - following its href location. But here really the
> effective JS event property is 'stopPropagation' which has been extracted
> to its own property in AjaxRequestAttributes.
>
> A workaround is to use:
>
> getAjaxRequestTargetListeners().add(new AjaxRequestTarget.AbstractListener()
> {
>   @Override
> public void updateAjaxAttributes(AjaxRequestAttributes attributes)
> {
>   super.updateAjaxAttributes(attributes);
>
> attributes.setAllowDefault(true);
> }
>   });
>
> in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
> released.
>
> What do you think ? Should we fix this and release 6.8.1 as soon as
> possible ?
>


Re: AjaxRequestAttributes#allowDefault in 6.8.0

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, May 22, 2013 at 10:04 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> I think we need 6.8.1 because of the problem in
> https://issues.apache.org/jira/browse/WICKET-5194.
>  The quickstart shows that textField.add(new AjaxEventBehavior("keydown"))
> doesn't work because the event' default behavior is prevented.
>
> org.apache.wicket.ajax.attributes.AjaxRequestAttributes#allowDefault
> default value was 'false' since 6.0.0 but it seems it was not used at all
> in many cases before the changes in WICKET-5093:
>
>
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a11ce8a7e3b575385d8f03db62130517a2b80d09
>
> https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=6eec04b135a60c31fac7b74b866d9fdcc862ef30
>
> I suggest to change the default value of 'allowDefault' to 'true'.
>
> Do you see any use cases where the value should be 'false' ?
> The 'false' value was because AjaxFallbackLink should not execute it
> default behavior - following its href location. But here really the
> effective JS event property is 'stopPropagation' which has been extracted
> to its own property in AjaxRequestAttributes.
>

Correction:
AjaxFallback*** should do setAllowDefault(false).

I'll attach a patch to the ticket soon.


>
> A workaround is to use:
>
> getAjaxRequestTargetListeners().add(new
> AjaxRequestTarget.AbstractListener()
> {
>  @Override
> public void updateAjaxAttributes(AjaxRequestAttributes attributes)
> {
>  super.updateAjaxAttributes(attributes);
>
> attributes.setAllowDefault(true);
> }
>  });
>
> in YourApp#init(). But we cannot ask all users to do this until 6.9.0 is
> released.
>
> What do you think ? Should we fix this and release 6.8.1 as soon as
> possible ?
>