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 2012/01/30 09:13:03 UTC

Why ComponentTag's behaviors are executed after Component's behaviors ?

Hi,

What is the reason the (more static, auto) ComponentTag's behaviors to
be executed *after* the (more dynamic, user supplied) Component's
behaviors ?
See org.apache.wicket.Component#renderComponentTag(ComponentTag).

ComponentTag behaviors are usually added in IMarkupFilters (see
org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler#onComponentTag
and org.apache.wicket.markup.parser.filter.WicketMessageTagHandler#onComponentTag)
but those are not override-able by user-supplied behaviors because of
the order in  Component#renderComponentTag(ComponentTag).

The use case is: wicket:message="title:titleKey" should be used most
of the time but in some case the developer wanted to use a dynamic
title attribute with AttributeModifier.replace("title",
dynamicTitleModel)

-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: Why ComponentTag's behaviors are executed after Component's behaviors ?

Posted by Martin Grigorov <mg...@apache.org>.
Thanks, Juergen!

I've created https://issues.apache.org/jira/browse/WICKET-4369.
If there are no objections in the next few days I'll change the order for 1.5.5.

On Mon, Jan 30, 2012 at 11:06 AM, Juergen Donnerstag
<ju...@gmail.com> wrote:
> Hi,
>
> no specific reason I think. So far nobody ask for it with a good use
> case. I think it's ok to change the order.
>
> -Juergen
>
> On Mon, Jan 30, 2012 at 9:13 AM, Martin Grigorov <mg...@apache.org> wrote:
>> Hi,
>>
>> What is the reason the (more static, auto) ComponentTag's behaviors to
>> be executed *after* the (more dynamic, user supplied) Component's
>> behaviors ?
>> See org.apache.wicket.Component#renderComponentTag(ComponentTag).
>>
>> ComponentTag behaviors are usually added in IMarkupFilters (see
>> org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler#onComponentTag
>> and org.apache.wicket.markup.parser.filter.WicketMessageTagHandler#onComponentTag)
>> but those are not override-able by user-supplied behaviors because of
>> the order in  Component#renderComponentTag(ComponentTag).
>>
>> The use case is: wicket:message="title:titleKey" should be used most
>> of the time but in some case the developer wanted to use a dynamic
>> title attribute with AttributeModifier.replace("title",
>> dynamicTitleModel)
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

Re: Why ComponentTag's behaviors are executed after Component's behaviors ?

Posted by Juergen Donnerstag <ju...@gmail.com>.
Hi,

no specific reason I think. So far nobody ask for it with a good use
case. I think it's ok to change the order.

-Juergen

On Mon, Jan 30, 2012 at 9:13 AM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> What is the reason the (more static, auto) ComponentTag's behaviors to
> be executed *after* the (more dynamic, user supplied) Component's
> behaviors ?
> See org.apache.wicket.Component#renderComponentTag(ComponentTag).
>
> ComponentTag behaviors are usually added in IMarkupFilters (see
> org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler#onComponentTag
> and org.apache.wicket.markup.parser.filter.WicketMessageTagHandler#onComponentTag)
> but those are not override-able by user-supplied behaviors because of
> the order in  Component#renderComponentTag(ComponentTag).
>
> The use case is: wicket:message="title:titleKey" should be used most
> of the time but in some case the developer wanted to use a dynamic
> title attribute with AttributeModifier.replace("title",
> dynamicTitleModel)
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com