use of org.apache.wicket.markup.html.panel.FeedbackPanel in project midpoint by Evolveum.
the class PrismValuePanel method initLayout.
private void initLayout(IModel<String> labelModel, Form form, String valueCssClass, String inputCssClass) {
//container
WebMarkupContainer valueContainer = new WebMarkupContainer(ID_VALUE_CONTAINER);
valueContainer.setOutputMarkupId(true);
valueContainer.add(new AttributeModifier("class", valueCssClass));
add(valueContainer);
//feedback
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK);
feedback.setOutputMarkupId(true);
add(feedback);
//input
Panel input = createInputComponent(ID_INPUT, labelModel, form);
input.add(new AttributeModifier("class", inputCssClass));
if (input instanceof InputPanel) {
initAccessBehaviour((InputPanel) input);
feedback.setFilter(new ComponentFeedbackMessageFilter(((InputPanel) input).getBaseFormComponent()));
} else if (input instanceof LockoutStatusPanel) {
feedback.setFilter(new ComponentFeedbackMessageFilter(input));
} else if (input instanceof ValueChoosePanel) {
feedback.setFilter(new ComponentFeedbackMessageFilter(input));
} else if (input instanceof AssociationValueChoicePanel) {
feedback.setFilter(new ComponentFeedbackMessageFilter(((AssociationValueChoicePanel) input).getTextComponent()));
}
valueContainer.add(input);
//buttons
AjaxLink addButton = new AjaxLink(ID_ADD_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
addValue(target);
}
};
addButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return isAddButtonVisible();
}
});
valueContainer.add(addButton);
AjaxLink removeButton = new AjaxLink(ID_REMOVE_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
removeValue(target);
}
};
removeButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return isRemoveButtonVisible();
}
});
valueContainer.add(removeButton);
}
use of org.apache.wicket.markup.html.panel.FeedbackPanel in project midpoint by Evolveum.
the class AssociationValueChoicePanel method initLayout.
private void initLayout(final IModel<PrismContainerValue<ShadowAssociationType>> value, final List<PrismPropertyValue> values, final boolean required, Class<C> type) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupId(true);
TextField<String> text = new TextField<>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
feedback.setFilter(new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
AjaxLink edit = new AjaxLink(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(target);
}
};
edit.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return model.getObject().isEmpty();
}
});
textWrapper.add(edit);
add(textWrapper);
initDialog(type, values);
}
use of org.apache.wicket.markup.html.panel.FeedbackPanel 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.markup.html.panel.FeedbackPanel in project midpoint by Evolveum.
the class AuditLogViewerPanel method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK);
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
initParametersPanel(mainForm);
addOrReplaceTable(mainForm);
}
use of org.apache.wicket.markup.html.panel.FeedbackPanel in project midpoint by Evolveum.
the class ValueChoosePanel method initLayout.
private void initLayout(final IModel<T> value, final List<PrismReferenceValue> values, final boolean required, Collection<Class<? extends O>> types) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupId(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(value));
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
textWrapper.add(feedback);
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(values, target);
}
};
textWrapper.add(edit);
add(textWrapper);
initButtons();
}
Aggregations