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/06/17 23:44:30 UTC

Deprecating wicket:enclosure

Hi,

We have several issues in Jira related to the same problem  -
<wicket:enclosure> hides its children/parents from the other components
while traversing the tree.
See https://issues.apache.org/jira/browse/WICKET-5214 and my last comment
for the links to the other tickets.

There is a simple solution to this problem - use EnclosureContainer
explicitly in Java code.

I'd like to deprecate <wicket:enclosure> and remove Enclosure,
InlineEnclosure and the related classes.
Until now I think we have removed only <wicket:component> in Wicket 1.5 but
it wasn't used so much.

Do you see another solution ?

Re: Deprecating wicket:enclosure

Posted by tetsuo <ro...@gmail.com>.
What about moving this functionality directly into MarkupContainer, so that
there's no need for an additional 'magic' component? Would it be feasible?



On Tue, Jun 18, 2013 at 9:37 AM, Nick Pratt <nb...@gmail.com> wrote:

> -1 to deprecate.  Same reasons as Igor stated.
>
> On Mon, Jun 17, 2013 at 5:44 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > Hi,
> >
> > We have several issues in Jira related to the same problem  -
> > <wicket:enclosure> hides its children/parents from the other components
> > while traversing the tree.
> > See https://issues.apache.org/jira/browse/WICKET-5214 and my last
> comment
> > for the links to the other tickets.
> >
> > There is a simple solution to this problem - use EnclosureContainer
> > explicitly in Java code.
> >
> > I'd like to deprecate <wicket:enclosure> and remove Enclosure,
> > InlineEnclosure and the related classes.
> > Until now I think we have removed only <wicket:component> in Wicket 1.5
> but
> > it wasn't used so much.
> >
> > Do you see another solution ?
> >
>

Re: Deprecating wicket:enclosure

Posted by Nick Pratt <nb...@gmail.com>.
-1 to deprecate.  Same reasons as Igor stated.

On Mon, Jun 17, 2013 at 5:44 PM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> We have several issues in Jira related to the same problem  -
> <wicket:enclosure> hides its children/parents from the other components
> while traversing the tree.
> See https://issues.apache.org/jira/browse/WICKET-5214 and my last comment
> for the links to the other tickets.
>
> There is a simple solution to this problem - use EnclosureContainer
> explicitly in Java code.
>
> I'd like to deprecate <wicket:enclosure> and remove Enclosure,
> InlineEnclosure and the related classes.
> Until now I think we have removed only <wicket:component> in Wicket 1.5 but
> it wasn't used so much.
>
> Do you see another solution ?
>

Re: Deprecating wicket:enclosure

Posted by Cedric Gatay <ga...@gmail.com>.
I tried to fix the 5214 yesterday and it might break to many things. I
guess the problem is misunderstanding of the good use to make for
Enclosure.
May be we can change the log level indicating an unrendered component with
a transparent parent in result of the call
to org.apache.wicket.Page#hasInvisibleTransparentChild() .

Ideally we should write a log trace in warning if the detected parent is an
Enclosure and keep debug  in other cases.

__
Cedric Gatay (@Cedric_Gatay <http://twitter.com/Cedric_Gatay>)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr


On Tue, Jun 18, 2013 at 8:19 AM, Guillaume Smet <gu...@gmail.com>wrote:

> On Tue, Jun 18, 2013 at 7:55 AM, Igor Vaynberg <ig...@gmail.com>
> wrote:
> > some uis are prone to having a lot of these. eg when you hide a form
> > component you also want to hide some static help markup. without
> > enclosures this means having an extra container for each form
> > component with dynamic visibility.
>
> I agree with Igor. We use EnclosureContainer for the complicated cases
> but using wicket:enclosure is really nice for simple things and we use
> it a lot.
>
> Would it be possible to emit warnings when using wicket:enclosure is
> buggy? I don't if it's possible to detect these cases.
>
> --
> Guillaume
>

Re: Deprecating wicket:enclosure

Posted by Sven Meier <sv...@meiers.net>.
I had too much trouble already with enclosures, InlineEnclosure being 
even worse than Enclosure (because the former is not removed after render).

So +1 on deprecating enclosures, +1 on fixing (=redesigning) them.

Sven


On 06/18/2013 09:06 AM, Martin Grigorov wrote:
> It seems it is just me who prefers to avoid the usage of auto-components
> (i.e. magic) in my projects.
>
> I'm going to link all open tickets with this problem and close all but one
> of them.
>
>
> On Tue, Jun 18, 2013 at 9:54 AM, martin.dilger <martin.dilger@googlemail.com
>> wrote:
>> Just to give my 3 pens,
>> I agree with Igor too, <wicket:enclosure/> is really handy in most cases, I
>> would strongly disagree to remove it. We use it a lot in our projects and
>> rarely have problems with it. And if I think of the impact it would have
>> for
>> our projects to refactor everything to use EnclosureContainer instead...
>>
>> The Problem <wicket:enclosure/> solves is not something I want to be
>> reflected in code, it´s far more handy to just handle that in the markup.
>> If
>> there are problems with the <wicket:enclosure/>-Tag, we should solve them.
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Deprecating-wicket-enclosure-tp4659572p4659578.html
>> Sent from the Forum for Wicket Core developers mailing list archive at
>> Nabble.com.
>>


Re: Deprecating wicket:enclosure

Posted by Martin Grigorov <mg...@apache.org>.
It seems it is just me who prefers to avoid the usage of auto-components
(i.e. magic) in my projects.

I'm going to link all open tickets with this problem and close all but one
of them.


On Tue, Jun 18, 2013 at 9:54 AM, martin.dilger <martin.dilger@googlemail.com
> wrote:

> Just to give my 3 pens,
> I agree with Igor too, <wicket:enclosure/> is really handy in most cases, I
> would strongly disagree to remove it. We use it a lot in our projects and
> rarely have problems with it. And if I think of the impact it would have
> for
> our projects to refactor everything to use EnclosureContainer instead...
>
> The Problem <wicket:enclosure/> solves is not something I want to be
> reflected in code, it´s far more handy to just handle that in the markup.
> If
> there are problems with the <wicket:enclosure/>-Tag, we should solve them.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Deprecating-wicket-enclosure-tp4659572p4659578.html
> Sent from the Forum for Wicket Core developers mailing list archive at
> Nabble.com.
>

Re: Deprecating wicket:enclosure

Posted by "martin.dilger" <ma...@googlemail.com>.
Just to give my 3 pens,
I agree with Igor too, <wicket:enclosure/> is really handy in most cases, I
would strongly disagree to remove it. We use it a lot in our projects and
rarely have problems with it. And if I think of the impact it would have for
our projects to refactor everything to use EnclosureContainer instead... 

The Problem <wicket:enclosure/> solves is not something I want to be
reflected in code, it´s far more handy to just handle that in the markup. If
there are problems with the <wicket:enclosure/>-Tag, we should solve them.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Deprecating-wicket-enclosure-tp4659572p4659578.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.

Re: Deprecating wicket:enclosure

Posted by Guillaume Smet <gu...@gmail.com>.
On Tue, Jun 18, 2013 at 7:55 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> some uis are prone to having a lot of these. eg when you hide a form
> component you also want to hide some static help markup. without
> enclosures this means having an extra container for each form
> component with dynamic visibility.

I agree with Igor. We use EnclosureContainer for the complicated cases
but using wicket:enclosure is really nice for simple things and we use
it a lot.

Would it be possible to emit warnings when using wicket:enclosure is
buggy? I don't if it's possible to detect these cases.

-- 
Guillaume

Re: Deprecating wicket:enclosure

Posted by Igor Vaynberg <ig...@gmail.com>.
these things are usually added after the fact, which means you have to
add the container then go find all the children that should be added
into it and change the parent of the add() calls. just like any time
when you have to insert a container into existing hierarchy, but one
of the primary usecases is to do what the enclosures do.

having these containers in code adds a lot of noise.

some uis are prone to having a lot of these. eg when you hide a form
component you also want to hide some static help markup. without
enclosures this means having an extra container for each form
component with dynamic visibility.

enclosures were born as a practical solution to these frustrating
problems. if they are broken they need to be fixed, but removing them
is not an option i dont think.

-igor



On Mon, Jun 17, 2013 at 10:32 PM, Martin Grigorov <mg...@apache.org> wrote:
> By pain what do you mean ? More code to write or some other problems ?
>
> What to do with these tickets ? I can close all but one as duplicates and
> link them ...
>
>
> On Tue, Jun 18, 2013 at 3:12 AM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> even though wicket:enclosure doesnt work for every single situation
>> out there it is still immensely useful because it works for 90% use
>> cases out there. so -1 to deprecate. in fact, the reason we introduced
>> it in the first place was because adding EnclosureContainer-like
>> components in code was a pain.
>>
>> -igor
>>

Re: Deprecating wicket:enclosure

Posted by Martin Grigorov <mg...@apache.org>.
By pain what do you mean ? More code to write or some other problems ?

What to do with these tickets ? I can close all but one as duplicates and
link them ...


On Tue, Jun 18, 2013 at 3:12 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> even though wicket:enclosure doesnt work for every single situation
> out there it is still immensely useful because it works for 90% use
> cases out there. so -1 to deprecate. in fact, the reason we introduced
> it in the first place was because adding EnclosureContainer-like
> components in code was a pain.
>
> -igor
>

Re: Deprecating wicket:enclosure

Posted by Igor Vaynberg <ig...@gmail.com>.
even though wicket:enclosure doesnt work for every single situation
out there it is still immensely useful because it works for 90% use
cases out there. so -1 to deprecate. in fact, the reason we introduced
it in the first place was because adding EnclosureContainer-like
components in code was a pain.

-igor