afff
cara, uma coisa tão simples… e do nada ta dando erro…
Já cansei de ficar quebrando a cabeça aqui… e n vejo nada de errado!
PQP viu…
olhem só o form:
<h:panelGrid columns="2">
<p:outputLabel for="#{msg['entity.codigo']}" value="#{msg['entity.codigo']}"/>
<p:inputText id="#{msg['entity.codigo']}" value="#{grupoController.entity.id}" />
<p:outputLabel for="#{msg['entity.descricao']}" value="#{msg['entity.descricao']}"/>
<p:inputText id="#{msg['entity.descricao']}" value="#{grupoController.entity.descricao}" />
<p:outputLabel for="#{msg['entity.grupo.tipo']}" value="#{msg['entity.grupo.tipo']}"/>
<p:selectOneMenu id="#{msg['entity.grupo.tipo']}" converter="tipoGrupoConverter" value="#{grupoController.entity.tipo}" >
<f:selectItems value="#{grupoController.selectTipoGrupo}" />
</p:selectOneMenu>
<p:commandButton value="#{msg['button.save']}" ajax="false"
actionListener="#{grupoController.saveOrUpdate}"
action="#{grupoController.actionSave}" />
<p:commandButton value="#{msg['button.saveAndContinue']}" ajax="false"
actionListener="#{grupoController.saveOrUpdate}"
action="#{grupoController.actionSaveAndContinue}" />
</h:panelGrid>
PS: h:form está no template.xhtml
Cara não tem nada de errado nem na Entity (get e set estão lá):
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
pra completar os action e actionlistener:
--------- classe abstrata
public void saveOrUpdate(ActionEvent event) {
try {
getBaseService().save(entity);
displayInfoMessageToUser("Saved With Sucess");
} catch (Exception e) {
displayErrorMessageToUser("Ops, we could not create. Try again later");
e.printStackTrace();
}
}
-------------Actions na classe concreta
@Override
public String actionEdit() {
return "/view/grupo/form";
}
@Override
public String actionSave() {
return "/view/grupo/index";
}
@Override
public String actionInsert() {
return "/view/grupo/form";
}
@Override
public String actionSaveAndContinue() {
return "/view/grupo/form";
}
Detalhe: ele seta o ENUM e não seta uma simples String (descricao).
complicado néw