You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Socheat KHAUV (JIRA)" <ji...@apache.org> on 2016/12/04 06:01:58 UTC

[jira] [Created] (WICKET-6292) Button.onSubmit does not get call when Form have FileUploadField

Socheat KHAUV created WICKET-6292:
-------------------------------------

             Summary: Button.onSubmit does not get call when Form have FileUploadField
                 Key: WICKET-6292
                 URL: https://issues.apache.org/jira/browse/WICKET-6292
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 8.0.0-M2
            Reporter: Socheat KHAUV


{code:title=HomePage.java|borderStyle=solid}
public class HomePage extends WebPage {
    private static final long serialVersionUID = 1L;

    private List<FileUpload> file;

    public HomePage(final PageParameters parameters) {
        super(parameters);

        Form<Void> form = new Form<>("form");
        add(form);

        FileUploadField fileUploads = new FileUploadField("file", new PropertyModel<>(this, "file"));
        form.add(fileUploads);

        Button components = Button.onSubmit("button", this::buttonOnSubmit);
        form.add(components);

    }

    private void buttonOnSubmit(Button button) {
        System.out.println("test");
    }

}
{code}

{code:title=HomePage.html|borderStyle=solid}
<form wicket:id="form">
    <input type="file" wicket:id="file">
    <input type="submit" wicket:id="button" value="Okay">
</form>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)