01: /*
02: * $Id: MockPageWithFormAndCheckGroup.java 462210 2006-09-13 22:22:21Z frankbille $
03: * $Revision: 462210 $
04: * $Date: 2006-09-14 00:22:21 +0200 (Thu, 14 Sep 2006) $
05: *
06: * ==============================================================================
07: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
08: * use this file except in compliance with the License. You may obtain a copy of
09: * the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16: * License for the specific language governing permissions and limitations under
17: * the License.
18: */
19: package wicket.util.tester;
20:
21: import java.util.ArrayList;
22: import java.util.List;
23:
24: import wicket.ajax.AjaxRequestTarget;
25: import wicket.ajax.markup.html.form.AjaxSubmitLink;
26: import wicket.markup.html.WebPage;
27: import wicket.markup.html.form.Check;
28: import wicket.markup.html.form.CheckGroup;
29: import wicket.markup.html.form.Form;
30: import wicket.model.Model;
31: import wicket.model.PropertyModel;
32:
33: /**
34: * Mock page with form and checkgroup.
35: *
36: * @author Frank Bille (billen)
37: */
38: public class MockPageWithFormAndCheckGroup extends WebPage {
39: private static final long serialVersionUID = 1L;
40:
41: private List selected = new ArrayList();
42:
43: /**
44: * Construct.
45: */
46: public MockPageWithFormAndCheckGroup() {
47: Form form = new Form("form");
48: add(form);
49:
50: CheckGroup checkGroup = new CheckGroup("checkGroup",
51: new PropertyModel(this , "selected"));
52: form.add(checkGroup);
53:
54: checkGroup.add(new Check("check1", new Model(new Integer(1))));
55: checkGroup.add(new Check("check2", new Model(new Integer(2))));
56:
57: add(new AjaxSubmitLink("submitLink", form) {
58: private static final long serialVersionUID = 1L;
59:
60: protected void onSubmit(AjaxRequestTarget target, Form form) {
61: }
62: });
63: }
64:
65: /**
66: * @return selected
67: */
68: public List getSelected() {
69: return selected;
70: }
71:
72: /**
73: * @param selected
74: */
75: public void setSelected(List selected) {
76: this.selected = selected;
77: }
78: }
|