Repository: wicket Updated Branches: refs/heads/master f4edcd82b -> f733de4e6
Added a paragraph for wicketstuff-lambda-components Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f733de4e Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f733de4e Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f733de4e Branch: refs/heads/master Commit: f733de4e6611f7017ce04de20e29f0a930685fb3 Parents: f4edcd8 Author: Andrea Del Bene <[email protected]> Authored: Thu Jun 22 17:55:17 2017 +0200 Committer: Andrea Del Bene <[email protected]> Committed: Thu Jun 22 17:55:31 2017 +0200 ---------------------------------------------------------------------- wicket-user-guide/src/main/asciidoc/single.adoc | 4 ++++ .../asciidoc/wicketstuff/wicketstuff_7.adoc | 24 ++++++++++++++++++++ 2 files changed, 28 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/f733de4e/wicket-user-guide/src/main/asciidoc/single.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/single.adoc b/wicket-user-guide/src/main/asciidoc/single.adoc index e9f3bda..0accbba 100644 --- a/wicket-user-guide/src/main/asciidoc/single.adoc +++ b/wicket-user-guide/src/main/asciidoc/single.adoc @@ -855,6 +855,10 @@ include::wicketstuff/wicketstuff_5.adoc[leveloffset=+1] include::wicketstuff/wicketstuff_6.adoc[leveloffset=+1] +=== Module wicketstuff-lambda-components + +include::wicketstuff/wicketstuff_7.adoc[leveloffset=+1] + [appendix] == Lost In Redirection With Apache Wicket http://git-wip-us.apache.org/repos/asf/wicket/blob/f733de4e/wicket-user-guide/src/main/asciidoc/wicketstuff/wicketstuff_7.adoc ---------------------------------------------------------------------- diff --git a/wicket-user-guide/src/main/asciidoc/wicketstuff/wicketstuff_7.adoc b/wicket-user-guide/src/main/asciidoc/wicketstuff/wicketstuff_7.adoc new file mode 100644 index 0000000..32641cf --- /dev/null +++ b/wicket-user-guide/src/main/asciidoc/wicketstuff/wicketstuff_7.adoc @@ -0,0 +1,24 @@ +This module comes with class _org.wicketstuff.lambda.components.ComponentFactory_ which exposes a number of factory method to build components using Lambda expressions as event handler. This can be useful to create components with simple behavior. For example: + +[source,java] +---- +//create a standard link component +add(ComponentFactory.link("id", (link) -> {/*do stuff*/}); + +//create an AJAX link component +add(ComponentFactory.ajaxLink("id", (ajaxLink, ajaxTarget) -> {/*do stuff*/}); +---- + +_AjaxButton_ and _AjaxSubmitLink_ are also supported: + +[source,java] +---- +//create a submit link +add(ComponentFactory.ajaxSubmitLink("id", (ajaxLink, ajaxTarget) -> {/*do submit stuff*/}); + +//create a submit link with error handler +add(ComponentFactory.ajaxSubmitLink("id", (ajaxLink, ajaxTarget) -> {/*do submit stuff*/}, + (ajaxLink, ajaxTarget) -> {/*do error stuff*/}); +---- + +See _ComponentFactory_ JavaDoc for a full list of factory methods. \ No newline at end of file
