use of org.apache.wicket.validation.validator.RangeValidator in project midpoint by Evolveum.
the class PageSizePopover method initLayout.
protected void initLayout() {
Button popButton = new Button(ID_POP_BUTTON);
popButton.setOutputMarkupId(true);
add(popButton);
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
Form form = new Form(ID_FORM);
popover.add(form);
AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {
@Override
protected void onError(AjaxRequestTarget target, Form<?> form) {
super.onError(target, form);
target.add(getPageBase().getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
pageSizeChanged(target);
}
};
form.add(button);
TextField input = new TextField(ID_INPUT, createInputModel());
input.add(new RangeValidator(5, 100));
input.setLabel(createStringResource("PageSizePopover.title"));
input.add(new SearchFormEnterBehavior(button));
input.setType(Integer.class);
form.add(input);
}
use of org.apache.wicket.validation.validator.RangeValidator in project midpoint by Evolveum.
the class TableConfigurationPanel method initPopoverLayout.
private void initPopoverLayout() {
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
Form form = new Form(ID_FORM);
popover.add(form);
AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {
@Override
protected void onError(AjaxRequestTarget target, Form<?> form) {
target.add(TableConfigurationPanel.this.get(createComponentPath(ID_POPOVER, ID_FORM, "inputFeedback")));
}
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
pageSizeChanged(target);
}
};
form.add(button);
TextField input = new TextField(ID_INPUT, createInputModel());
input.add(new RangeValidator(5, 100));
input.setLabel(createStringResource("PageSizePopover.title"));
input.add(new SearchFormEnterBehavior(button));
input.setType(Integer.class);
input.setOutputMarkupId(true);
FeedbackPanel feedback = new FeedbackPanel("inputFeedback", new ComponentFeedbackMessageFilter(input));
feedback.setOutputMarkupId(true);
form.add(feedback);
form.add(input);
}
use of org.apache.wicket.validation.validator.RangeValidator in project ocvn by devgateway.
the class EditAdminSettingsPage method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
editForm.add(new Label("excelTitle", new StringResourceModel("excelTitle", this, null)));
excelBatchSize = new TextFieldBootstrapFormComponent<>("excelBatchSize");
excelBatchSize.integer();
excelBatchSize.getField().add(new RangeValidator(1, 10000));
excelBatchSize.required();
editForm.add(excelBatchSize);
editForm.add(new Label("systemTitle", new StringResourceModel("systemTitle", this, null)));
// rebootServer = new CheckBoxToggleBootstrapFormComponent("rebootServer");
// editForm.add(rebootServer);
disableApiSecurity = new CheckBoxToggleBootstrapFormComponent("disableApiSecurity");
editForm.add(disableApiSecurity);
}
Aggregations