01: /*
02: * $Id: AjaxLinkWithBorderPage.java 460038 2006-03-29 19:12:08Z jdonnerstag $
03: * $Revision: 460038 $ $Date: 2006-03-29 21:12:08 +0200 (Wed, 29 Mar 2006) $
04: *
05: * ==================================================================== Licensed
06: * under the Apache License, Version 2.0 (the "License"); you may not use this
07: * file except in compliance with the License. You may obtain a copy of the
08: * License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.ajax.markup.html.ajaxLink;
19:
20: import wicket.ajax.AjaxRequestTarget;
21: import wicket.ajax.markup.html.AjaxLink;
22: import wicket.markup.html.WebPage;
23: import wicket.markup.html.basic.Label;
24: import wicket.model.PropertyModel;
25:
26: /**
27: *
28: */
29: public class AjaxLinkWithBorderPage extends WebPage {
30: private static final long serialVersionUID = 1L;
31:
32: private String labelText = "UpdateMe";
33:
34: /**
35: * Construct.
36: */
37: public AjaxLinkWithBorderPage() {
38: add(new AjaxTestBorder("border").setTransparentResolver(true));
39:
40: final Label label = new Label("ajaxLabel", new PropertyModel(
41: this , "labelText"));
42: label.setOutputMarkupId(true);
43: add(label);
44: add(new AjaxLink("ajaxLink") {
45: private static final long serialVersionUID = 1L;
46:
47: public void onClick(AjaxRequestTarget target) {
48: labelText = "Updated!";
49: target.addComponent(label);
50: }
51: });
52: }
53:
54: /**
55: *
56: * @return String
57: */
58: public String getLabelText() {
59: return labelText;
60: }
61: }
|