0

グループ作成の確認メッセージを表示したいのですが、表示できません。

group.xhtml:

 <h:form id="grp">
            <h:panelGrid columns="2"> 

            <h:outputText value="Titre:"></h:outputText>
            <p:inputText value="#{gpeBean.titre}"></p:inputText>

        <p:commandButton  id="btn_save"
                     value="Créer"                             
                     actionListener="#{gpeBean.test}">
                      </p:commandButton>

                    </h:panelGrid>  
     </h:form>

        </center>
     </h:panelGrid>
      <h:form id="cr" rendered = "#{gpeBean.created}"> 
       <h:outputText value="#{gpeBean.message}"/>
     </h:form>

私の豆:

@ManagedBean(name = "gpeBean")
@RequestScoped
public class GroupeBean implements Serializable{
GroupDAO daoGrp = new GroupDaoImpl();
UserDAO dao = new UserDaoImpl();
private String titre;
public String message = "";
private boolean created = false;

    public String test(ActionEvent event){
    Groupe p = new Groupe();
    p.setTitre(this.titre);
    daoGrp.Nouveau_groupe(p);
    created = true;
    this.setMessage("Groupe crée!");
    return "p1";
   }}

ボタンをクリックしてメソッドテストを実行すると、メッセージが表示されません。

4

1 に答える 1