FileDocCategorySizeDatePackage
MyBean.javaAPI DocExample824Tue Jun 08 11:26:42 BST 2004com.mycompany.beans

MyBean

public class MyBean extends Object

Fields Summary
private javax.faces.component.html.HtmlOutputText
errorComp
Constructors Summary
Methods Summary
public javax.faces.component.html.HtmlOutputTextgetErrorComp()

	return errorComp;
    
public voidsetErrorComp(javax.faces.component.html.HtmlOutputText errorComp)

	this.errorComp = errorComp;
    
public voidvalidateText(javax.faces.context.FacesContext context, javax.faces.component.UIComponent comp, java.lang.Object value)

	if ("the kitchen sink".equals(value)) {
	    errorComp.setValue("I said anything but!");
	    errorComp.setStyle("color: red");
	    comp.getAttributes().put("style", "color: red");
	}
	else {
	    errorComp.setValue(null);
	    errorComp.setStyle(null);
	    comp.getAttributes().put("style", null);
	}