/** * @param id * The component ID * @param boxes * checkBoxes this selector will control */ public CheckBoxSelector(String id, CheckBox... boxes) { super(id); for (CheckBox box : boxes) { connectedCheckBoxes.add(box); box.add(cleanup); } }
/** * @param id * The component ID * @param boxes * checkBoxes this selector will control */ public CheckBoxSelector(String id, CheckBox... boxes) { super(id); for (CheckBox box : boxes) { connectedCheckBoxes.add(box); box.add(cleanup); } }
@Override protected CheckBox newCheckBox(final String id, final IModel<Boolean> model) { final CheckBox checkBox = super.newCheckBox(id, model); checkBox.add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { private static final long serialVersionUID = -1107858522700306810L; @Override protected void onUpdate(final AjaxRequestTarget target) { } }); return checkBox; }
@Override protected CheckBox newCheckBox(final String id, final IModel<Boolean> model) { final CheckBox checkBox = super.newCheckBox(id, model); checkBox.add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(final AjaxRequestTarget target) { } }); return checkBox; } }.setOutputMarkupPlaceholderTag(true));
@Override protected CheckBox newCheckBox(String id, IModel<Boolean> model) { CheckBox checkBox = super.newCheckBox(id, model); checkBox.add(new AttributeAppender("disabled", "disabled")); return checkBox; }
@Override protected CheckBox newCheckBox(String id, IModel<Boolean> model) { CheckBox checkBox = super.newCheckBox(id, model); checkBox.add(new AttributeAppender("disabled", "disabled")); return checkBox; }
Component defaultStyleCheckbox(String id, IModel itemModel) { final LayerGroupEntry entry = (LayerGroupEntry) itemModel.getObject(); Fragment f = new Fragment(id, "defaultStyle", this); CheckBox ds = new CheckBox("checkbox", new Model(entry.isDefaultStyle())); ds.add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { Boolean useDefault = (Boolean) getComponent().getDefaultModelObject(); entry.setDefaultStyle(useDefault); target.addComponent(layerTable); } }); f.add(ds); return f; }
private Component internalAdd(Behavior behavior) { if (AjaxEventBehavior.class.isAssignableFrom(behavior.getClass())) { AjaxEventBehavior ajaxEventBehavior = (AjaxEventBehavior) behavior; button.add(new DelegateEventBehavior(ajaxEventBehavior.getEvent(), checkbox)); checkbox.add(ajaxEventBehavior); return this; } return super.add(behavior); }
Component defaultStyleCheckbox(String id, IModel<LayerGroupEntry> itemModel) { final LayerGroupEntry entry = (LayerGroupEntry) itemModel.getObject(); Fragment f = new Fragment(id, "defaultStyle", this); CheckBox ds = new CheckBox("checkbox", new Model<Boolean>(entry.isDefaultStyle())); ds.add( new OnChangeAjaxBehavior() { private static final long serialVersionUID = 7700386104410665242L; @Override protected void onUpdate(AjaxRequestTarget target) { Boolean useDefault = (Boolean) getComponent().getDefaultModelObject(); entry.setDefaultStyle(useDefault); target.add(layerTable); } }); f.add(ds); return f; }
private CheckBox newStepCheckboxField(final ModbusConfigurationEntry configEntry) { final CheckBox checkboxField = new CheckBox("step", new PropertyModel<Boolean>(configEntry, "designatorRange.step")); checkboxField.add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { configEntry.getDesignatorRange().setStep(checkboxField.getModelObject()); } }); return checkboxField; }
/** * If activated then the check box is colored (red). This is useful for checkb-oxes which have an important rule on something other, e. g. * "show only deleted" check-box in list view should be highlighted. * @return */ public CheckBoxPanel setWarning() { if (label.isVisible() == true) { label.add(AttributeModifier.append("class", "warning")); } else { checkBox.add(AttributeModifier.append("class", "warning")); } return this; }
CheckBox selectAllCheckbox() { CheckBox sa = new CheckBox("selectAll", new PropertyModel(this, "selectAllValue")); sa.setOutputMarkupId(true); sa.add(new AjaxFormComponentUpdatingBehavior("onclick") { @Override protected void onUpdate(AjaxRequestTarget target) { // select all the checkboxes setSelection(selectAllValue); // update table and the checkbox itself target.addComponent(getComponent()); target.addComponent(listContainer); // allow subclasses to play on this change as well onSelectionUpdate(target); } }); return sa; }
CheckBox selectAllCheckbox() { CheckBox sa = new CheckBox("selectAll", new PropertyModel<Boolean>(this, "selectAllValue")); sa.setOutputMarkupId(true); sa.add( new AjaxFormComponentUpdatingBehavior("click") { private static final long serialVersionUID = 1154921156065269691L; @Override protected void onUpdate(AjaxRequestTarget target) { // select all the checkboxes setSelection(selectAllValue); // update table and the checkbox itself target.add(getComponent()); target.add(listContainer); // allow subclasses to play on this change as well onSelectionUpdate(target); } }); return sa; }
protected CheckBox selectOneCheckbox(Item item) { CheckBox cb = new CheckBox("selectItem", new SelectionModel(item.getIndex())); cb.setOutputMarkupId(true); cb.add(new AjaxFormComponentUpdatingBehavior("onclick") { @Override protected void onUpdate(AjaxRequestTarget target) { if(Boolean.FALSE.equals(getComponent().getDefaultModelObject())) { selectAllValue = false; target.addComponent(selectAll); } onSelectionUpdate(target); } }); return cb; }
public void populateItem(final ListItem<FieldValueModel> item) { FieldValueModel fieldValueModel = item.getModelObject(); // TODO: make sure non-existing value field gets focus if last edit happened there // unary FieldInstanceAssociationUnaryField unaryField = new FieldInstanceAssociationUnaryField("fieldValue", fieldValueModel, readonly); unaryField.getCheckBox().add(new FieldUpdatingBehaviour(false)); item.add(unaryField); addNewFieldValueCssClass(item, fieldValuesModel, fieldValueModel); } };
@Override public void populateItem(final ListItem<FieldValueModel> item) { FieldValueModel fieldValueModel = item.getModelObject(); // TODO: make sure non-existing value field gets focus if last edit happened there // unary FieldInstanceAssociationUnaryField unaryField = new FieldInstanceAssociationUnaryField("fieldValue", fieldValueModel, readonly); unaryField.getCheckBox().add(new FieldUpdatingBehaviour(false)); item.add(unaryField); addNewFieldValueCssClass(item, fieldValuesModel, fieldValueModel); } };
public BooleanLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); value = new CheckBox("value"); value.setOutputMarkupId(true); value.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> t.add(getParent()))); add(value); }
public BooleanLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); value = new CheckBox("value"); value.setOutputMarkupId(true); value.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> t.add(getParent()))); add(value); }
protected CheckBox selectOneCheckbox(Item<T> item) { CheckBox cb = new CheckBox("selectItem", new SelectionModel(item.getIndex())); cb.setOutputMarkupId(true); cb.setVisible(selectable); cb.add( new AjaxFormComponentUpdatingBehavior("click") { private static final long serialVersionUID = -2419184741329470638L; @Override protected void onUpdate(AjaxRequestTarget target) { if (Boolean.FALSE.equals(getComponent().getDefaultModelObject())) { selectAllValue = false; target.add(selectAll); } onSelectionUpdate(target); } }); return cb; }
@Override protected void onInitialize() { super.onInitialize(); add(input = new CheckBox("input", Model.of(getModelObject()))); input.add(new AjaxFormComponentUpdatingBehavior("change"){ @Override protected void onUpdate(AjaxRequestTarget target) { onPropertyUpdating(target); } }); input.setLabel(Model.of(getDescriptor().getDisplayName(this))); }