Examples of FormComponent


Examples of org.apache.wicket.markup.html.form.FormComponent

   * @see org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
   */
  @Override
  protected final void respond(final AjaxRequestTarget target)
  {
    final FormComponent formComponent = getFormComponent();

    try
    {
      formComponent.inputChanged();
      formComponent.validate();
      if (formComponent.hasErrorMessage())
      {
        formComponent.invalid();

        onError(target, null);
      }
      else
      {
        formComponent.valid();
        formComponent.updateModel();
        onUpdate(target);
      }
    }
    catch (RuntimeException e)
    {
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

    if (formComponents != null && formComponents.length > 0)
    {
      Map<String, Object> args = new HashMap<String, Object>(formComponents.length * 3);
      for (int i = 0; i < formComponents.length; i++)
      {
        final FormComponent formComponent = formComponents[i];

        String arg = "label" + i;
        IModel<?> label = formComponent.getLabel();
        if (label != null)
        {
          args.put(arg, label.getObject());
        }
        else
        {
          args.put(arg, formComponent.getLocalizer().getString(formComponent.getId(),
            formComponent.getParent(), formComponent.getId()));
        }

        args.put("input" + i, formComponent.getInput());
        args.put("name" + i, formComponent.getId());
      }
      return args;
    }
    else
    {
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   */
  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);
    }
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   *            index of selectable option, start from 0
   */
  public void select(String formComponentId, int index)
  {
    checkClosed();
    FormComponent component = (FormComponent)workingForm
    .get(formComponentId);

    ChoiceSelector choiceSelector = choiceSelectorFactory.create(component);
    choiceSelector.doSelect(index);
    if (component instanceof DropDownChoice) {
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   */
  public void setValue(final String formComponentId, final String value)
  {
    checkClosed();

    FormComponent formComponent = (FormComponent)workingForm.get(formComponentId);
    setFormComponentValue(formComponent, value);
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   */
  public void setFile(final String formComponentId, final File file, final String contentType)
  {
    checkClosed();

    FormComponent formComponent = (FormComponent)workingForm.get(formComponentId);

    if (formComponent instanceof FileUploadField == false)
    {
      throw new IllegalArgumentException("'" + formComponentId + "' is not "
          + "a FileUploadField. You can only attach a file to form "
          + "component of this type.");
    }

    MockHttpServletRequest servletRequest = baseWicketTester.getServletRequest();
    servletRequest.addFile(formComponent.getInputName(), file, contentType);
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   *
   * @see org.apache.wicket.ajax.AjaxEventBehavior#onEvent(org.apache.wicket.ajax.AjaxRequestTarget)
   */
  protected final void onEvent(final AjaxRequestTarget target)
  {
    final FormComponent formComponent = getFormComponent();

    try
    {
      formComponent.inputChanged();
      formComponent.validate();
      if (formComponent.hasErrorMessage())
      {
        formComponent.invalid();
       
        onError(target, null);
      }
      else
      {
        formComponent.valid();
        formComponent.updateModel();
        onUpdate(target);
      }
    }
    catch (RuntimeException e)
    {
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   *
   * @see wicket.ajax.AbstractDefaultAjaxBehavior#respond(wicket.ajax.AjaxRequestTarget)
   */
  protected final void respond(final AjaxRequestTarget target)
  {
    final FormComponent formComponent = getFormComponent();

    try
    {
      formComponent.inputChanged();
      formComponent.validate();
      if (formComponent.hasErrorMessage())
      {
        formComponent.invalid();

        onError(target, null);
      }
      else
      {
        formComponent.valid();
        formComponent.updateModel();
        onUpdate(target);
      }
    }
    catch (RuntimeException e)
    {
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

  {
    // initialize
    this.form.loadPersistentFormComponentValues();

    // validate
    FormComponent username = (FormComponent)panel.get("signInForm:username");

    Assert.assertNotNull(username);

    Assert.assertNotNull(cookieUsername);

    Assert.assertEquals(cookieUsername.getValue(), username.getDefaultModelObjectAsString());
  }
View Full Code Here

Examples of org.apache.wicket.markup.html.form.FormComponent

   *
   * @see wicket.ajax.AbstractDefaultAjaxBehavior#respond(wicket.ajax.AjaxRequestTarget)
   */
  protected final void respond(final AjaxRequestTarget target)
  {
    final FormComponent formComponent = getFormComponent();

    try
    {
      formComponent.inputChanged();
      formComponent.validate();
      if (formComponent.hasErrorMessage())
      {
        formComponent.invalid();
       
        onError(target, null);
      }
      else
      {
        formComponent.valid();
        formComponent.updateModel();
        onUpdate(target);
      }
    }
    catch (RuntimeException e)
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.