0
JSF 2.2の単純なプロジェクトで作業していますが、いくつかのページを移動する際に問題があります。プロジェクトでは私は一般的なテンプレートを持っており、すべてのビューは一般的なテンプレートのテンプレートクライアントです。マネージドBeanを使用したナビゲーション
これは私がトラブルしているという見方である。
のcommandButtonの作用で<h:body>
<ui:composition template="./LayoutGeneral.xhtml">
<ui:define name="content">
<p:commandButton value="Registrar Comunidad" action="#{comunidadBean.irRegisterView}"/>
</ui:define>
</ui:composition>
</h:body>
は私がに呼び出す他の方法を持っている管理対象Bean(タールは、管理対象Beanからメソッドを呼び出しますページを変更し、彼らが正常に動作しますが、この方法のdoesntの):マネージドBean
()
@ManagedBean
@SessionScoped
public class ComunidadBean {
private String idComunidad;
private String idPresidente;
private String calle;
private int numero;
private int nVecinos;
@EJB
private ComunidadDAO ejb;
public String register(){
if(ejb.realizaRegistro(this)){
return "principalView";
} else{
FacesMessage fm = new FacesMessage ("No se pudo registrar");
FacesContext.getCurrentInstance().addMessage("msg", fm);
return null;
}
}
public String irRegisterView(){
return "registroCView";
}
}
"register"メソッドは正常に動作し、ページは変更されますが、メソッド "irRegisterView"は "registroCView"ページに移動しません。
誰かが何が起きているのか考えていますか?
ありがとうございます!
ありがとうございます!問題は、commandButtonがフォーム内になかったことです!私はそれがそうでなければならないことを知りませんでした! –