use of de.agilecoders.wicket.extensions.markup.html.bootstrap.form.checkbox.bootstraptoggle.BootstrapToggleConfig in project ocvn by devgateway.
the class CheckBoxToggleBootstrapFormComponent method inputField.
@Override
protected BootstrapToggle inputField(final String id, final IModel<Boolean> model) {
config = new BootstrapToggleConfig();
config.withOnStyle(BootstrapToggleConfig.Style.info).withOffStyle(BootstrapToggleConfig.Style.warning).withStyle("customCssClass");
final BootstrapToggle checkBoxToggle = new BootstrapToggle("field", initFieldModel(), config) {
private static final long serialVersionUID = 1L;
@Override
protected CheckBox newCheckBox(final String id, final IModel<Boolean> model) {
wrappedCheckbox = super.newCheckBox(id, model);
wrappedCheckbox.add(new AjaxFormComponentUpdatingBehavior("change") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
CheckBoxToggleBootstrapFormComponent.this.onUpdate(target);
}
});
return wrappedCheckbox;
}
};
return checkBoxToggle;
}
Aggregations