Hi,

for this 'corner case' we might just as well pass in the link as argument:

public static <T> Link<T> onClick(String id, WicketConsumer<Link<T>> onClick)

    add(Link.onClick("adminAnnotInternalLink", link -> ...));

This might be handy if you want to do something with the link (update, replace, etc.)

Have fun
Sven


On 15.06.2016 12:45, Martin Grigorov wrote:
Hi,

I've started refactoring wicket-examples to use more of the Java 8
functionalities in Wicket and
I've found a problem with Link#onClick(String, WicketConsumer<Void>) method.
See
https://github.com/apache/wicket/commit/5d87f50646d13d858eab69d7892075be8cdb1dbd#diff-0419829765d01bcc9911c318ea9bba4e
Here I needed to use "(ignoreme)" as an input for the lambda to make it
compileable.
The problem is that Java 8 doesn't provide Consumer without an input.
Here is a discussion about this:
http://programmers.stackexchange.com/questions/276859/what-is-the-name-of-a-function-that-takes-no-argument-and-returns-nothing

Shall we introduce our own Consumer0/Procedure/Command or use
java.lang.Runnable in the API ?


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


Reply via email to