public BasicAuthFilterPanel(String id, IModel<BasicAuthenticationFilterConfig> model) { super(id, model); add(new CheckBox("useRememberMe")); } }
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; }
public FormComponent[] getDependentFormComponents() { if (enabled.getModelObject()) { return advancedConfigPanel.getDependentFormComponents(); } else { return new FormComponent[] {urlFormComponent}; } }
/** * @see org.apache.wicket.markup.html.form.IOnChangeListener#onSelectionChanged() */ public void onSelectionChanged() { convertInput(); updateModel(); onSelectionChanged(getModelObject()); }
/** * @see org.projectforge.web.wicket.flowlayout.ComponentWrapperPanel#getComponentOutputId() */ @Override public String getComponentOutputId() { checkBox.setOutputMarkupId(true); return checkBox.getMarkupId(); }
/** * Factory method for create a new {@link CheckBox}. * * @param id * the id * @param model * the model * @return the new {@link CheckBox} */ public static CheckBox newCheckBox(final String id, final IModel<Boolean> model) { final CheckBox checkBox = new CheckBox(id, model); checkBox.setOutputMarkupId(true); return checkBox; }
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; }
public UserGroupServicePanel(String id, IModel<T> model) { super(id, model); add(new PasswordEncoderChoice("passwordEncoderName").add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { if (recodeCheckBox.isVisible()) { recodeCheckBox.setEnabled(true); target.addComponent(recodeCheckBox); } } })); boolean canCreateStore=false; SecurityUserGroupServiceConfig config = model.getObject(); try { GeoServerUserGroupService s = (GeoServerUserGroupService) Class.forName(config.getClassName()).newInstance(); canCreateStore=s.canCreateStore(); } catch (Exception e) { // do nothing } recodeCheckBox= new CheckBox("recodeExistingPasswords", Model.of(false)); recodeCheckBox.setOutputMarkupId(true); recodeCheckBox.setVisible(canCreateStore); recodeCheckBox.setEnabled(false); add(recodeCheckBox); add(new PasswordPolicyChoice("passwordPolicyName")); }
/** * Construct a new BooleanField. * * @param id the Wicket id for the editor. * @param model the model. * @param metaData the meta data for the property. * @param viewOnly true if the component should be view-only. */ public BooleanField(String id, IModel model, ElementMetaData metaData, boolean viewOnly) { super(id, model, metaData, viewOnly); CheckBox checkBox = new CheckBox("component", model) ; checkBox.setEnabled(!viewOnly); add(checkBox); } }
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))); }
/** * @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); } }
private void addHstRepositoryBasedMenuConfiguration() { CheckBox repositoryBased = new CheckBox("repobased"); repositoryBased.setOutputMarkupId(true); repositoryBased.setEnabled(!getLockInfo().isLocked()); form.add(repositoryBased); CheckBox foldersOnly = new CheckBox("foldersOnly"); foldersOnly.setOutputMarkupId(true); foldersOnly.setEnabled(!getLockInfo().isLocked()); form.add(foldersOnly); TextField depth = new TextField("depth"); depth.setOutputMarkupId(true); depth.add(new RangeValidator(0l, null)); depth.setEnabled(!getLockInfo().isLocked()); form.add(depth); }
@Override protected void onUpdate(AjaxRequestTarget target) { if (administratorInput.getModelObject()) canCreateProjectsInput.setModelObject(true); target.add(canCreateProjectsInput); }
@Override protected void onConfigure() { super.onConfigure(); setEnabled(!administratorInput.getModelObject()); }
/** * @param id * @param model * @param labelString If null then a classic checkbox is used. * @param wantOnSelectionChangedNotifications if true then wantOnSelectionChangedNotifications method returns true. * @see CheckBox#wantOnSelectionChangedNotifications() */ public CheckBoxButton(final String id, final IModel<Boolean> model, final String labelString, final boolean wantOnSelectionChangedNotifications) { super(id); this.wantOnSelectionChangedNotifications = wantOnSelectionChangedNotifications; checkBox = new CheckBox(WICKET_ID, model) { @Override public void onSelectionChanged(final Boolean newSelection) { CheckBoxButton.this.onSelectionChanged(newSelection); } @Override protected boolean wantOnSelectionChangedNotifications() { return CheckBoxButton.this.wantOnSelectionChangedNotifications(); } }; checkBox.setOutputMarkupId(true); init(labelString); labelContainer.add(checkBox); }
@Override protected void onEvent(AjaxRequestTarget target) { enabled.processInput(); boolean enableSettings = Boolean.TRUE.equals(enabled.getModelObject()); settings.visitChildren( (component, visit) -> { component.setEnabled(enableSettings); }); target.add(settings); } });
private void disableDimension( Class<?> type, final WebMarkupContainer configs, Label noAttributeMessage) { // no attributes of the required type, no party enabled.setEnabled(false); enabled.setModelObject(false); configs.setVisible(false); ParamResourceModel typeName = new ParamResourceModel("AttributeType." + type.getSimpleName(), null); ParamResourceModel error = new ParamResourceModel("missingAttribute", this, typeName.getString()); noAttributeMessage.setDefaultModelObject(error.getString()); }
@Override protected void onUpdate(AjaxRequestTarget target) { if (recodeCheckBox.isVisible()) { recodeCheckBox.setEnabled(true); target.addComponent(recodeCheckBox); } } }));
@Override protected void onUpdate(AjaxRequestTarget target) { for (CheckBox cb : methodList) { cb.setEnabled(chainWrapper.isMatchHTTPMethod()); target.addComponent(cb); } } }));