List of usage examples for org.apache.wicket.markup.html.form Form hasFeedbackMessage
public final boolean hasFeedbackMessage()
From source file:org.hippoecm.frontend.widgets.NameUriField.java
License:Apache License
private Component createUrlAction() { final AjaxLink<Boolean> uriAction = new AjaxLink<Boolean>("uriAction") { @Override/*from w w w.j a v a2 s . co m*/ public void onClick(final AjaxRequestTarget target) { urlIsEditable = !urlIsEditable; urlComponent.modelChanging(); urlModel.setObject(getName()); urlComponent.modelChanged(); final Form<?> form = urlComponent.getForm(); if (form.hasFeedbackMessage()) { form.getFeedbackMessages().clear(); } if (!urlComponent.isValid()) { urlComponent.validate(); } target.add(this); target.add(urlComponent); target.focusComponent(urlIsEditable ? urlComponent : nameComponent); } }; uriAction.add(new Label("uriActionLabel", ReadOnlyModel.of(() -> getString(urlIsEditable ? "url-reset" : "url-edit")))); return uriAction; }