@Override public void validate(Form<?> form) { // we have a choice to validate the type converted values or the raw // input values, we validate the raw input final FormComponent<?> formComponent1 = components[0]; final FormComponent<?> formComponent2 = components[1]; if (!Objects.equal(formComponent1.getInput(), formComponent2.getInput())) { error(formComponent2); } }
@Override public void validate(Form<?> form) { // we have a choice to validate the type converted values or the raw // input values, we validate the raw input final FormComponent<?> formComponent1 = components[0]; final FormComponent<?> formComponent2 = components[1]; if (!Objects.equal(formComponent1.getInput(), formComponent2.getInput())) { error(formComponent2); } }
/** * {@inheritDoc} */ @Override public String getInput() { return getFormComponent().getInput(); } }
/** * {@inheritDoc} */ @Override public String getInput() { return getFormComponent().getInput(); }
private String getCronField(final FormComponent<?> formComponent, final int field) { String cronField = null; if (formComponent != null) { cronField = getCronField(formComponent.getInput(), field); } return cronField; }
/** * @see org.apache.wicket.markup.html.form.validation.IFormValidator#validate(org.apache.wicket.markup.html.form.Form) */ public void validate(Form<?> form) { // we have a choice to validate the type converted values or the raw // input values, we validate the raw input final FormComponent<?> formComponent1 = components[0]; final FormComponent<?> formComponent2 = components[1]; if (!Objects.equal(formComponent1.getInput(), formComponent2.getInput())) { error(formComponent2); } }
/** * @see org.apache.wicket.markup.html.form.validation.IFormValidator#validate(org.apache.wicket.markup.html.form.Form) */ public void validate(Form form) { // we have a choice to validate the type converted values or the raw // input values, we validate the raw input final FormComponent formComponent1 = components[0]; final FormComponent formComponent2 = components[1]; if (!Objects.equal(formComponent1.getInput(), formComponent2.getInput())) { error(formComponent2); } }
/** * Gets the request parameter for this component as an int. * * @return The value in the request for this component */ protected final int inputAsInt() { final String string = getInput(); try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException( exceptionMessage("Internal error. Request string '" + string + "' not a valid integer")); } }
/** * Gets the request parameter for this component as an int. * * @return The value in the request for this component */ protected final int inputAsInt() { final String string = getInput(); try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException( exceptionMessage("Internal error. Request string '" + string + "' not a valid integer")); } }
/** * Gets the request parameter for this component as an int. * * @return The value in the request for this component */ protected final int inputAsInt() { final String string = getInput(); try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException( exceptionMessage("Internal error. Request string '" + string + "' not a valid integer")); } }
/** * Gets the request parameter for this component as an int. * * @return The value in the request for this component */ protected final int inputAsInt() { final String string = getInput(); try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException( exceptionMessage("Internal error. Request string '" + string + "' not a valid integer")); } }
/** * Gets the request parameter for this component as an int. * * @return The value in the request for this component */ protected final int inputAsInt() { final String string = getInput(); try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException( exceptionMessage("Internal error. Request string '" + string + "' not a valid integer")); } }
@Override protected void onUpdate(AjaxRequestTarget target) { // IE triggers "input" event when the focused on the search input even if nothing is // input into search box yet. To work around this issue, we compare search string // against previous value to only update the branches table if there is an actual // change. String newInput = ((FormComponent<?>)getComponent()).getInput(); if (!Objects.equals(newInput, input)) { input = newInput; onTypingDone(target); } }
/** * Gets the request parameter for this component as an int, using the given default in case no * corresponding request parameter was found. * * @param defaultValue * Default value to return if request does not have an integer for this component * @return The value in the request for this component */ protected final int inputAsInt(final int defaultValue) { final String string = getInput(); if (string != null) { try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException(exceptionMessage("Request string '" + string + "' is not a valid integer")); } } else { return defaultValue; } }
/** * Gets the request parameter for this component as an int, using the given default in case no * corresponding request parameter was found. * * @param defaultValue * Default value to return if request does not have an integer for this component * @return The value in the request for this component */ protected final int inputAsInt(final int defaultValue) { final String string = getInput(); if (string != null) { try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException(exceptionMessage("Request string '" + string + "' is not a valid integer")); } } else { return defaultValue; } }
/** * Gets the request parameter for this component as an int, using the given default in case no * corresponding request parameter was found. * * @param defaultValue * Default value to return if request does not have an integer for this component * @return The value in the request for this component */ protected final int inputAsInt(final int defaultValue) { final String string = getInput(); if (string != null) { try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException(exceptionMessage("Request string '" + string + "' is not a valid integer")); } } else { return defaultValue; } }
/** * Gets the request parameter for this component as an int, using the given default in case no * corresponding request parameter was found. * * @param defaultValue * Default value to return if request does not have an integer for this component * @return The value in the request for this component */ protected final int inputAsInt(final int defaultValue) { final String string = getInput(); if (string != null) { try { return Integer.parseInt(string); } catch (NumberFormatException e) { throw new IllegalArgumentException(exceptionMessage("Request string '" + string + "' is not a valid integer")); } } else { return defaultValue; } }
@Override protected void onUpdate(AjaxRequestTarget target) { FormComponent<?> component = (FormComponent<?>) getComponent(); // IE triggers "input" event when the focused on the search input even if nothing is // input into search box yet. To work around this issue, we compare search string // against previous value to only update the branches table if there is an actual // change. String newInput = component.getInput(); if (!Objects.equals(newInput, input)) { input = newInput; onInputChange(target); } }
@Override protected void onValidate(IValidatable validatable) { String url = (String) validatable.getValue(); try { HTTPClient client = new SimpleHttpClient(); usernamePanel.getFormComponent().processInput(); String user = usernamePanel.getFormComponent().getInput(); password.getFormComponent().processInput(); String pwd = password.getFormComponent().getInput(); if (user != null && user.length() > 0 && pwd != null && pwd.length() > 0) { client.setUser(user); client.setPassword(pwd); } WebMapServer server = new WebMapServer(new URL(url), client); server.getCapabilities(); } catch(Exception e) { error(validatable, "WMSCapabilitiesValidator.connectionFailure", Collections.singletonMap("error", e.getMessage())); } }
final String input = getInput();