package com.bloatit.web.pages;

import com.bloatit.framework.webserver.annotations.ParamContainer;
import com.bloatit.framework.webserver.components.form.HtmlFileInput;
import com.bloatit.framework.webserver.components.form.HtmlForm;
import com.bloatit.framework.webserver.components.form.HtmlSubmit;
import com.bloatit.framework.webserver.components.form.HtmlTextField;
import com.bloatit.web.pages.master.MasterPage;
import com.bloatit.web.url.FileUploadPageUrl;
import com.bloatit.web.url.IndexPageUrl;

@ParamContainer("file/upload")
public class FileUploadPage extends MasterPage {

    public FileUploadPage(final FileUploadPageUrl url) {
        super(url);
    }

    @Override
    protected String getPageTitle() {
        return "Upload a file";
    }

    @Override
    public boolean isStable() {
        return false;
    }

    @Override
    public void doCreate() {
        final HtmlForm plop = new HtmlForm(new IndexPageUrl().urlString());
        add(plop);

        plop.addAttribute("enctype", "multipart/form-data");

        final HtmlTextField htf = new HtmlTextField("wow");
        plop.add(htf);

        final HtmlFileInput hfi = new HtmlFileInput("fichier");
        plop.add(hfi);
        plop.add(new HtmlSubmit("Send"));
    }
}

@@ -92,16 +92,75 @@
 tainer;%0A
+import com.bloatit.framework.webserver.components.HtmlDiv;%0A
 import c
@@ -1017,16 +1017,47 @@
         
+add(new HtmlDiv(%22padding_box%22).
 add(plop
@@ -1057,16 +1057,17 @@
 dd(plop)
+)
 ;%0A%0A     

fix an style horror