/*
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 */

/*
 * $Id: FormUIBean.java 62525 2011-04-15 12:14:31Z dougd $
 */
package com.sun.ts.tests.jsf.spec.render.form;

import javax.faces.application.Application;
import javax.faces.component.html.HtmlForm;
import javax.faces.component.html.HtmlInputText;
import javax.faces.context.FacesContext;

public class FormUIBean {

    private HtmlForm myForm;

    public HtmlForm getMyForm() {
        return myForm;
    }

    public void setMyForm(HtmlForm myForm) {
        Application application =
                FacesContext.getCurrentInstance().getApplication();
        HtmlInputText hello = (HtmlInputText) application.createComponent(HtmlInputText.COMPONENT_TYPE);

        hello.setId("hello_msg");
        hello.setValue("HELLO");
        
        myForm.setStyleClass("fancy");
        myForm.getChildren().add(hello);

        this.myForm = myForm;
    }
}
