<h:form>
<a:comp id="test" value="${bean.test.text}"></h:form>
<f:validateBean for="#{bean.test}"/>
</a:comp>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a="http://java.sun.com/jsf/composite/ajax"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="value" required="true" type="Object" />
<composite:editableValueHolder name="value" targets="value" />
</composite:interface>
<composite:implementation>
<h:message id="inputErr" for="input"/><br/>
<h:inputText id="input" value="#{cc.attrs.value}" >
<f:ajax execute="@this" render="@this inputErr" />
</h:inputText>
</composite:implementation>
</html>
public class ValidationCriteriaExampleBean
{
@Size(min=4, max=255)
private String text;
public String getText()
{
return text;
}
public void setText(final String validation)
{
this.text = validation;
}
}
-- Lincoln Baxter, III Co-Founder of OcpSoft Creator of: PrettyFaces: URL rewriting for JSF PrettyTime: Java elapsed timestamp formatting |