mvn archetype:create -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.4.7 -DgroupId=ru.habrahabr.helowicket -DartifactId=helloworld
package ru.habrahabr.helowicket;<br><br>import org.apache.wicket.protocol.http.WebApplication;<br><br> public class WicketApplication extends WebApplication<br>{ <br> public WicketApplication()<br> {<br> }<br> public Class<HomePage> getHomePage()<br> {<br> return HomePage. class ;<br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
as well as HomePage.html and HomePage.java files containing the corresponding markup and page logic (files must have the same name and different extensions).< html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < strong > Wicket Quickstart Archetype Homepage </ strong > <br> < br />< br /> <br> < span wicket:id ="message" > message will be here </ span > <br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
package ru.habrahabr;<br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.markup.html.WebPage;<br><br> public class HomePage extends WebPage {<br><br> private static final long serialVersionUID = 1L;<br><br> public HomePage(final PageParameters parameters) {<br> add( new Label( "message" , "If you see this message wicket is properly configured and running" ));<br> }<br>} <br><br> * This source code was highlighted with Source Code Highlighter .
I think the meaning is clear, but in 2 words I will comment. The markup file contains the line< span wicket:id ="message" > message will be here </ span > <br><br> * This source code was highlighted with Source Code Highlighter .
so that in java code it becomes possible to access this element using the stringadd(new Label("message", "If you see this message wicket is properly configured and running"));
add(new Label("message", new Date().toString()));
"message will be here"
from the markup file. How it works we can see by clicking the magic button in your favorite IDE. To open a project, for example, in eclipse, use the mvn eclipse:eclipse -DdownloadSources=true
in the project directory. The full list of spells is on the Wicket site. You can do it easier by typing: mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter . . label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter . label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter . . - Wicket', , .
PS. , .
mvn tomcat:run
.
AJAX. , . : < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < head > <br> < title > Wicket Quickstart Archetype Homepage </ title > <br> </ head > <br> < body > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ body > <br> </ html > <br> <br> * This source code was highlighted with Source Code Highlighter .
. label link . java : public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br> <br> * This source code was highlighted with Source Code Highlighter .
label . link . , PropertyModel (this) "time", . .
" ". SiteMech , Wicket . , - <wicket:child/> <wicket:extend> . java ( BasePage) HomePage. :
BasePage.html < html xmlns:wicket ="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" > <br> < body > <br> < div > <br> <!-- --> <br> < span wicket:id ="bpspan" ></ span > <br> < wicket:child /> <br> <!-- - --> <br> </ div > <br> </ body > <br> </ html > <br><br> * This source code was highlighted with Source Code Highlighter .
BasePage.java package ru.habranabr.helowicket;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.markup.html.WebPage;<br>import org.apache.wicket.markup.html.basic.Label;<br><br> /** <br> * @author office <br> */ <br> public class BasePage extends WebPage {<br><br> public BasePage(final PageParameters parameters) {<br> super(parameters);<br> add( new Label( "bpspan" , "Hello from BasePage!" ));<br> }<br>}<br><br> <br> * This source code was highlighted with Source Code Highlighter .
HomePage.html < wicket:extend > <br> < a href ="#" wicket:id ="link" > This link </ a > has been clicked<br> < span wicket:id ="label" > 123 </ span > times.<br> </ wicket:extend > <br><br> * This source code was highlighted with Source Code Highlighter .
HomePage.java import java.util.Date;<br><br>import org.apache.wicket.PageParameters;<br>import org.apache.wicket.ajax.AjaxRequestTarget;<br>import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;<br>import org.apache.wicket.markup.html.basic.Label;<br>import org.apache.wicket.model.PropertyModel;<br><br> public class HomePage extends BasePage {<br><br> private static final long serialVersionUID = 1L;<br> private Label label;<br> private String time;<br> <br> public HomePage(final PageParameters parameters) {<br> super(parameters);<br> add( new AjaxFallbackLink( "link" ) { <br> @Override<br> public void onClick(AjaxRequestTarget target) { <br> time = new Date().toString();<br> if (target != null ) { <br> target.addComponent(label); <br> }<br> }<br> });<br> label = new Label( "label" , new PropertyModel( this , "time" ));<br> label.setOutputMarkupId( true );<br> add(label);<br> <br> }<br>}<br> <br> * This source code was highlighted with Source Code Highlighter .
. - Wicket', , .
PS. , .
Source: https://habr.com/ru/post/89642/
All Articles