atom feed216 messages in org.apache.wicket.usersRe: Free wicket from component hierar...
FromSent OnAttachments
Martin MakundiNov 4, 2010 1:13 pm 
7zark7Nov 4, 2010 1:54 pm 
Jonathan LockeNov 4, 2010 3:06 pm 
Martin MakundiNov 4, 2010 3:08 pm 
Martin MakundiNov 4, 2010 3:13 pm 
Jeremy ThomersonNov 4, 2010 9:56 pm 
Martin MakundiNov 4, 2010 10:59 pm 
Martin MakundiNov 4, 2010 11:46 pm 
Michał LetyńskiNov 5, 2010 12:52 am 
Martin MakundiNov 5, 2010 1:07 am 
Martin GrigorovNov 5, 2010 1:12 am 
Martin MakundiNov 5, 2010 1:15 am 
Martin GrigorovNov 5, 2010 1:20 am 
Marc Nuri San FélixNov 5, 2010 1:22 am 
Martin MakundiNov 5, 2010 1:28 am 
Martin MakundiNov 5, 2010 1:31 am 
Martin GrigorovNov 5, 2010 1:34 am 
Martin GrigorovNov 5, 2010 1:36 am 
Martin MakundiNov 5, 2010 1:37 am 
Martin MakundiNov 5, 2010 1:38 am 
Martin MakundiNov 5, 2010 1:40 am 
Leszek GawronNov 5, 2010 5:36 am 
James CarmanNov 5, 2010 5:39 am 
Martin MakundiNov 5, 2010 5:47 am 
Igor VaynbergNov 5, 2010 9:55 am 
Jeremy ThomersonNov 5, 2010 10:00 am 
Martin MakundiNov 5, 2010 10:23 am 
Igor VaynbergNov 5, 2010 11:19 am 
Martin MakundiNov 5, 2010 11:39 am 
Eelco HilleniusNov 5, 2010 11:49 am 
Eelco HilleniusNov 5, 2010 11:56 am 
Martin MakundiNov 5, 2010 11:58 am 
Martin MakundiNov 5, 2010 12:00 pm 
Eelco HilleniusNov 5, 2010 12:15 pm 
Igor VaynbergNov 5, 2010 12:55 pm 
Brian ToppingNov 5, 2010 12:56 pm 
Martin MakundiNov 5, 2010 1:06 pm 
Martin MakundiNov 5, 2010 1:14 pm 
Igor VaynbergNov 5, 2010 1:21 pm 
Brian ToppingNov 5, 2010 1:32 pm 
Martin MakundiNov 5, 2010 10:05 pm 
Martin MakundiNov 5, 2010 10:07 pm 
Jeremy ThomersonNov 5, 2010 10:48 pm 
Martin MakundiNov 5, 2010 11:31 pm 
Igor VaynbergNov 5, 2010 11:53 pm 
Martin MakundiNov 5, 2010 11:57 pm 
James CarmanNov 6, 2010 5:12 am 
Martin MakundiNov 6, 2010 5:20 am 
Jeremy ThomersonNov 6, 2010 6:22 am 
Martin MakundiNov 6, 2010 6:43 am 
samketNov 6, 2010 6:54 am 
Igor VaynbergNov 6, 2010 4:44 pm 
SebastianNov 8, 2010 8:17 am 
Vitaly TsaplinNov 8, 2010 8:23 am 
Igor VaynbergNov 8, 2010 8:27 am 
Martin MakundiNov 8, 2010 8:29 am 
Igor VaynbergNov 8, 2010 8:35 am 
Vitaly TsaplinNov 8, 2010 8:35 am 
158 later messages
Subject:Re: Free wicket from component hierarchy hell
From:Martin Makundi (mart@koodaripalvelut.com)
Date:Nov 4, 2010 11:46:19 pm
List:org.apache.wicket.users

Hi!

We could also make so that "wicket:id" is old-school and "wicket:id:protected" is new-school.

No need to refactor anything.

Just pros without any cons.

** Martin

Hi!

Can you see how this would fail?

<html>  <form wicket:id="form1">    <input wicket:id="input" .../>  </form>  <form wicket:id="form2">    <input wicket:id="input" .../>  </form> </html>

That's old-school-wicket ;)

This would not be allowed anymore. An application would have to be refactored (using an automated script) into:

<html>  <form wicket:id="form1">   <input wicket:id="input-1" .../>  </form>  <form wicket:id="form2">   <input wicket:id="input-X" .../>  </form> </html>

We would simply change wicket syntax: panels and pages require unique wicket id for all components.

What about repeaters?

What about repeaters? Repeaters are generated on-the-fly anyways so they can be definitely computed on-the-fly.

What about if form1 was in BasePage.html and form2 was in HomePage.html (which extends BasePage.html) - how do we know which input component to get?  The one you called add on in BasePage.java, or the one in HomePage.java?  Oh, we can't differentiate which class you called add from within.  Oh, and you could have meant for the one added in HomePage.java to replace the one added in BasePage.java.

How do you propose we do all that?

You win some, you lose some. Nobody ever complained that parent and super classes cannot have protected fields with same names. Wicket:ids simply are considered protected-scoped. Maybe it could also be possible to define wicket:id:private which requires hierarcy and wicket:id which is "friendly" visibility etc.

When there is a will, there is a way.

** Martin