Re: Behavior#onTag() doesn't have the Component

2016-12-05 Thread Martin Grigorov
Changed with https://issues.apache.org/jira/browse/WICKET-6293 Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Sun, Dec 4, 2016 at 10:17 PM, Sven Meier wrote: > Hi Martin, > > > It is shorter with three chars "c, ". > > .. and two /parentheses.

Re: Behavior#onTag() doesn't have the Component

2016-12-04 Thread Sven Meier
Hi Martin, > It is shorter with three chars "c, ". .. and two /parentheses. /I though you knew of a shorter lambda syntax I wasn't aware of. I'm fine with a single method, at least it's consistent with #onComponentTag() this way. Have fun Sven On 04.12.2016 14:26, Martin Grigorov wrote:

Re: Behavior#onTag() doesn't have the Component

2016-12-04 Thread Martin Grigorov
Hi Sven label1.add(Behavior.onTag(t->t.put(key, label1.getId())); // 58 characters label1.add(Behavior.onTag((c, t)->t.put(key, label1.getId())); // 63 charactes "I'd like to preserve the first one because it's syntactically shorter." I thought that you say that the first example is

Re: Behavior#onTag() doesn't have the Component

2016-12-03 Thread Sven Meier
>It is shorter with three chars "c, " Can you explain how that works? Thanks Sven On 03.12.2016 12:36, Martin Grigorov wrote: On Sat, Dec 3, 2016 at 12:20 PM, Sven Meier wrote: Hi, I see your point. We could have both: label1.add(Behavior.onTag(t->t.put(key,

Re: Behavior#onTag() doesn't have the Component

2016-12-03 Thread Martin Grigorov
On Sat, Dec 3, 2016 at 12:20 PM, Sven Meier wrote: > Hi, > > I see your point. > > We could have both: > > label1.add(Behavior.onTag(t->t.put(key, label1.getId())); > label1.add(Behavior.onTag((c, t)->t.put(key, c.getId())); > > Both the Eclipse and JDK compiler accept

Re: Behavior#onTag() doesn't have the Component

2016-12-03 Thread Sven Meier
Hi, I see your point. We could have both: label1.add(Behavior.onTag(t->t.put(key, label1.getId())); label1.add(Behavior.onTag((c, t)->t.put(key, c.getId())); Both the Eclipse and JDK compiler accept these. The component should come as first argument as in

Re: Behavior#onTag() doesn't have the Component

2016-12-02 Thread Martijn Dashorst
But it would add another reference to the component, increasing the footprint. It also enables you to 'bind' to another (unintended) component that's available in the scope. Label label1 = new Label(...); ... Label label4 = new Label(...); label1.add(Behavior.onTag(t->t.put(key,

Re: Behavior#onTag() doesn't have the Component

2016-12-01 Thread Martin Grigorov
Agreed! Thanks! Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Nov 25, 2016 at 9:27 PM, Sven Meier wrote: > Hi, > > the behavior is added to a single component only and readily available > anyway in scope: > > component.add(onTag(tag

Re: Behavior#onTag() doesn't have the Component

2016-11-25 Thread Sven Meier
Hi, the behavior is added to a single component only and readily available anyway in scope: component.add(onTag(tag -> tag.put(key, component.getId())); What do we gain when the same component is given as argument? component.add(onTag(component, tag -> tag.put(key,