You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Juergen Donnerstag <ju...@gmail.com> on 2009/11/07 16:58:28 UTC

remove MarkupContainer.isTransparentResolver

Hi,

MarkupContainer.isTransparentResolver() regularly is the root cause
for some problems where users don't fully understand the implications.
It's main purpose is for auto-components which shall be "hidden" from
the user. Unfortunately it is at a very prominent position and may be
too easy to use.

IComponentResolver can do the same and is a the more generic approach.
In order to serve isTransparentResolver() there is special code spread
around core. I'd like to remove isTransparentResolver() from 1.5. I
made TransparentWebMarkupContainer a top level class and tested it.
It's working fine. What do you think?

-Juergen

Re: remove MarkupContainer.isTransparentResolver

Posted by James Carman <jc...@carmanconsulting.com>.
Sounds like a great opportunity to make things more intuitive and
avoid confusion.  +1 (non-binding) from me

On Sat, Nov 7, 2009 at 1:03 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> +1
>
> -igor
>
> On Sat, Nov 7, 2009 at 7:58 AM, Juergen Donnerstag
> <ju...@gmail.com> wrote:
>> Hi,
>>
>> MarkupContainer.isTransparentResolver() regularly is the root cause
>> for some problems where users don't fully understand the implications.
>> It's main purpose is for auto-components which shall be "hidden" from
>> the user. Unfortunately it is at a very prominent position and may be
>> too easy to use.
>>
>> IComponentResolver can do the same and is a the more generic approach.
>> In order to serve isTransparentResolver() there is special code spread
>> around core. I'd like to remove isTransparentResolver() from 1.5. I
>> made TransparentWebMarkupContainer a top level class and tested it.
>> It's working fine. What do you think?
>>
>> -Juergen
>>
>

Re: remove MarkupContainer.isTransparentResolver

Posted by Igor Vaynberg <ig...@gmail.com>.
+1

-igor

On Sat, Nov 7, 2009 at 7:58 AM, Juergen Donnerstag
<ju...@gmail.com> wrote:
> Hi,
>
> MarkupContainer.isTransparentResolver() regularly is the root cause
> for some problems where users don't fully understand the implications.
> It's main purpose is for auto-components which shall be "hidden" from
> the user. Unfortunately it is at a very prominent position and may be
> too easy to use.
>
> IComponentResolver can do the same and is a the more generic approach.
> In order to serve isTransparentResolver() there is special code spread
> around core. I'd like to remove isTransparentResolver() from 1.5. I
> made TransparentWebMarkupContainer a top level class and tested it.
> It's working fine. What do you think?
>
> -Juergen
>

Re: remove MarkupContainer.isTransparentResolver

Posted by Juergen Donnerstag <ju...@gmail.com>.
Yes, that should do as well

Juergen

On Tue, Nov 10, 2009 at 9:53 PM, Erik van Oosten <e....@grons.nl> wrote:
> Can we not use just this TransparentMarkupContainer and add the
> atrtibutemodifiers to that component?
>
>   Erik.
>
>
> Juergen Donnerstag wrote:
>>
>> Yes, it is trivial. Just copy the code from the
>> TransparentMarkupContainer (still on my disk).
>>
>> As another option: In 1.5 we removed the final keyword from
>> MarkupContainer.add(Component...) - see Border.java for the use case -
>> so that in 1.5 you may also subclass add() and thus keep the markup
>> and component hierarchies in sync.
>>
>> -Juergen
>>
>> On Mon, Nov 9, 2009 at 5:16 PM, Igor Vaynberg <ig...@gmail.com>
>> wrote:
>>
>>>
>>> you guys can still do that by allowing your webmarkupcontainer to
>>> implement icomponentresolver instead of simply overriding
>>> istransparentresolver(true). the impl itself should be trivia, just
>>> check for the component in the page body.
>>>
>>> -igor
>>>
>>>
>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>

Re: remove MarkupContainer.isTransparentResolver

Posted by Erik van Oosten <e....@grons.nl>.
Can we not use just this TransparentMarkupContainer and add the 
atrtibutemodifiers to that component?

    Erik.


Juergen Donnerstag wrote:
> Yes, it is trivial. Just copy the code from the
> TransparentMarkupContainer (still on my disk).
>
> As another option: In 1.5 we removed the final keyword from
> MarkupContainer.add(Component...) - see Border.java for the use case -
> so that in 1.5 you may also subclass add() and thus keep the markup
> and component hierarchies in sync.
>
> -Juergen
>
> On Mon, Nov 9, 2009 at 5:16 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>   
>> you guys can still do that by allowing your webmarkupcontainer to
>> implement icomponentresolver instead of simply overriding
>> istransparentresolver(true). the impl itself should be trivia, just
>> check for the component in the page body.
>>
>> -igor
>>
>>     


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


Re: remove MarkupContainer.isTransparentResolver

Posted by Juergen Donnerstag <ju...@gmail.com>.
Yes, it is trivial. Just copy the code from the
TransparentMarkupContainer (still on my disk).

As another option: In 1.5 we removed the final keyword from
MarkupContainer.add(Component...) - see Border.java for the use case -
so that in 1.5 you may also subclass add() and thus keep the markup
and component hierarchies in sync.

-Juergen

On Mon, Nov 9, 2009 at 5:16 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> you guys can still do that by allowing your webmarkupcontainer to
> implement icomponentresolver instead of simply overriding
> istransparentresolver(true). the impl itself should be trivia, just
> check for the component in the page body.
>
> -igor
>
> On Mon, Nov 9, 2009 at 7:08 AM, Erik van Oosten <e....@grons.nl> wrote:
>> Ah yes, I do that as well.
>>
>> Regards,
>>   Erik.
>>
>> Olivier Croisier wrote:
>>>
>>> I use the same technique (WebMarkupContainer + isTransparentResolver=true)
>>> on the <body> element to add an id attribute to it, with a unique value
>>> for
>>> each page extending the base template. This is useful to build unique CSS
>>> selectors for each page.
>>>
>>>
>>
>> --
>> Erik van Oosten
>> http://day-to-day-stuff.blogspot.com/
>>
>>
>>
>

Re: remove MarkupContainer.isTransparentResolver

Posted by Igor Vaynberg <ig...@gmail.com>.
you guys can still do that by allowing your webmarkupcontainer to
implement icomponentresolver instead of simply overriding
istransparentresolver(true). the impl itself should be trivia, just
check for the component in the page body.

-igor

On Mon, Nov 9, 2009 at 7:08 AM, Erik van Oosten <e....@grons.nl> wrote:
> Ah yes, I do that as well.
>
> Regards,
>   Erik.
>
> Olivier Croisier wrote:
>>
>> I use the same technique (WebMarkupContainer + isTransparentResolver=true)
>> on the <body> element to add an id attribute to it, with a unique value
>> for
>> each page extending the base template. This is useful to build unique CSS
>> selectors for each page.
>>
>>
>
> --
> Erik van Oosten
> http://day-to-day-stuff.blogspot.com/
>
>
>

Re: remove MarkupContainer.isTransparentResolver

Posted by Erik van Oosten <e....@grons.nl>.
Ah yes, I do that as well.

Regards,
    Erik.

Olivier Croisier wrote:
> I use the same technique (WebMarkupContainer + isTransparentResolver=true)
> on the <body> element to add an id attribute to it, with a unique value for
> each page extending the base template. This is useful to build unique CSS
> selectors for each page.
>
>   
-- 
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



Re: remove MarkupContainer.isTransparentResolver

Posted by Olivier Croisier <ol...@gmail.com>.
I use the same technique (WebMarkupContainer + isTransparentResolver=true)
on the <body> element to add an id attribute to it, with a unique value for
each page extending the base template. This is useful to build unique CSS
selectors for each page.



On Mon, Nov 9, 2009 at 2:59 PM, Erik van Oosten <e....@grons.nl>wrote:

> I want to set the 'xml:lang' and 'lang' attributes on the <html> tag. So I
> couple a WebMarkupContainer (that has isTransparentResolver overriden to
> return true) to the html tag on the base page of my projects. Then I simply
> add an AttributeModifier to it.
>
> I do it this way so that subclasses of the base page can simple use 'add'
> and don't have to do something like 'super.getParentContainer().add'.
>
> I did /not/ develop a filter/resolver.
>
>
> Regards,
>    Erik.
>
>
> Juergen Donnerstag wrote:
>
>> Hi Erik
>>
>> may I ask what you need it for in your project? Did you develop your
>> own markup filter/resolver?
>>
>> Juergen
>>
>>
>
> --
>
> Erik van Oosten
> http://day-to-day-stuff.blogspot.com/
>
>
>

Re: remove MarkupContainer.isTransparentResolver

Posted by Erik van Oosten <e....@grons.nl>.
I want to set the 'xml:lang' and 'lang' attributes on the <html> tag. So 
I couple a WebMarkupContainer (that has isTransparentResolver overriden 
to return true) to the html tag on the base page of my projects. Then I 
simply add an AttributeModifier to it.

I do it this way so that subclasses of the base page can simple use 
'add' and don't have to do something like 'super.getParentContainer().add'.

I did /not/ develop a filter/resolver.

Regards,
     Erik.


Juergen Donnerstag wrote:
> Hi Erik
>
> may I ask what you need it for in your project? Did you develop your
> own markup filter/resolver?
>
> Juergen
>   

-- 

Erik van Oosten
http://day-to-day-stuff.blogspot.com/



Re: remove MarkupContainer.isTransparentResolver

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

may I ask what you need it for in your project? Did you develop your
own markup filter/resolver?

Juergen

Re: remove MarkupContainer.isTransparentResolver

Posted by Erik van Oosten <e....@grons.nl>.
This will break almost every project I have (in a trivial way), but if 
it will simplify the Wicket core you have my:

+1 (non binding)


Regards,
    Erik.


Juergen Donnerstag wrote:
> Hi,
>
> MarkupContainer.isTransparentResolver() regularly is the root cause
> for some problems where users don't fully understand the implications.
> It's main purpose is for auto-components which shall be "hidden" from
> the user. Unfortunately it is at a very prominent position and may be
> too easy to use.
>
> IComponentResolver can do the same and is a the more generic approach.
> In order to serve isTransparentResolver() there is special code spread
> around core. I'd like to remove isTransparentResolver() from 1.5. I
> made TransparentWebMarkupContainer a top level class and tested it.
> It's working fine. What do you think?
>
> -Juergen
>   


-- 
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/