Thursday, December 8, 2011

PrimeFaces: The button/link/text component needs to have a Form in its ancestry. Please add

I got this warning while using a page:

The button/link/text component needs to have a Form in its ancestry. Please add <h:form>

By googling for a while I found it is a bug of Mojarra 2.1.1, so there are two posible solutions

1. Use Mojarra 2.0.4 which is the lastest stable mojarra release.
2. Change the param-value  "Production" of the to the param-name: javax.faces.PROJECT_STAGE:

<context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value> 
</context-param>

Resources:
http://www.geektilidie.com/?p=40
http://www.guj.com.br/java/240027-the-buttonlinktext-component-needs-to-have-a-form-in-its-ancestry-please-add-resolvido
http://code.google.com/p/primefaces/issues/detail?id=1586

No comments: