1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.client.console.wicket.markup.html.form;
20
21 import org.apache.syncope.client.ui.commons.Constants;
22 import org.apache.wicket.ajax.AjaxEventBehavior;
23 import org.apache.wicket.ajax.AjaxRequestTarget;
24 import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
25 import org.apache.wicket.model.IModel;
26
27
28
29
30 public abstract class AjaxDecoratedCheckbox extends AjaxCheckBox {
31
32 private static final long serialVersionUID = 7345848589265633002L;
33
34 public AjaxDecoratedCheckbox(final String id) {
35 this(id, null);
36 }
37
38 public AjaxDecoratedCheckbox(final String id, final IModel<Boolean> model) {
39 super(id, model);
40
41 add(new AjaxEventBehavior(Constants.ON_CLICK) {
42
43 private static final long serialVersionUID = -295188647830294610L;
44
45 @Override
46 protected void onEvent(final AjaxRequestTarget target) {
47 refreshComponent(target);
48 }
49 });
50 }
51
52 private void refreshComponent(final AjaxRequestTarget target) {
53 target.add(this);
54 }
55 }