Estranho, o meu template é simples, nao tem nenhum form, é so a estrutura mesmo.
Segue abaixo o template.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title><ui:insert name="title">Painéis Inteligentes</ui:insert></title>
</h:head>
<h:body>
<ui:insert name="header">
<h1>
<h:outputText value="Cabeçalho" />
</h1>
</ui:insert>
<ui:insert name="content">
</ui:insert>
<ui:insert name="footer">
<h:outputText value="Rodapé" />
</ui:insert>
</h:body>
</html>
Abaixo, o xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<ui:composition template="_template2.xhtml">
<ui:define name="content">
<h:form id="form">
<p:growl id="growl" showDetail="true" sticky="true" />
<h:panelGrid id="grid" columns="2">
<h:outputText id="name" value="Your Name: *" />
<p:inputText id="inputtext" value="#{testeBean.text}"
required="true" label="Name" />
</h:panelGrid>
<p:commandButton id="btn" value="Save"
actionListener="#{testeBean.teste}" update=":form:growl" />
</h:form>
</ui:define>
</ui:composition>
</html>
Abaixo o Bean.
@Named
@ViewScoped
public class TesteBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3972630720297924680L;
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public void teste() {
FacesContext context = FacesContext.getCurrentInstance();
System.out.println("Successful Hello " + text);
context.addMessage(null,
new FacesMessage("Successful", "Hello " + text));
context.addMessage(null, new FacesMessage("Second Message",
"Additional Info Here..."));
}
}
Abaixo a saida no console... o metodo esta sendo executado, passa por todas as fases, acredito que o problema é no retorno pra view,
pois o componente nao eh renderizado...
[img]http://dl.dropbox.com/u/17205416/Screen%20Shot%202012-04-02%20at%2021.11.02.png[/img]
... ocorre o erro, acho q nomento do update do componente growl... essa eh a resposata com erro gerada pela requisição...
[img]http://dl.dropbox.com/u/17205416/Screen%20Shot%202012-04-02%20at%2021.03.11.png[/img]
Nao imagino o motivo de isso estar acontencendo, pode ate ser um pequeno detalhe que esteja passando por cima sem
perceber, troquei ate o tema do primefaces...
Mais uma vez, obrigado pela solidariedade e atencao!