/*
 * $Id: Test4View.java 220 2007-07-16 10:32:15Z sugimotokenichi $
 * Copyright (C) 2004-2006 SUGIMOTO Ken-ichi
 * 作成日: 2006/04/20
 */
package feat2.testapp.test4;

import feat2.CommandContext;
import feat2.View;
import feat2.config.ViewConfig;
import feat2.template.HTMLDocument;
import feat2.template.HTMLNode;
import feat2.template.NodeFactory;
import feat2.template.form.Form;

public class Test4View implements View {

    private FormValues values;

    public HTMLDocument format(HTMLDocument template, ViewConfig cfg,
            CommandContext ctx) throws Exception {

        HTMLNode first = template.find("html/body").getFirstChild();
        first.insertBefore(NodeFactory.createHTMLText("フォームに値を入力した結果"));

        Form form = new Form(template.findElement("form1"));
        form.setValues(ctx.getRequest());

        return template;
    }



    public FormValues getValues() {
        return values;
    }

    public void setValues(FormValues values) {
        this.values = values;
    }

}
