1 Reply Latest reply on Jun 22, 2011 2:04 AM by Saroj Padhy

    rich:messages show onClick(Button)

    sirwayne Newbie

      Hello,

       

      i want to show a info message, if i clicked a Button. I want show this message only for this button.

      My try:

       

       

       

       

      <h:panelGrid id="panel2" columns="1">
      <rich:messages for="submit" />
      <h:commandButton value="Submit" action="#{controller.submit}" id="submit" />
      </h:panelGrid>
      

       

       

      @Named
      public class Controller{
      
      public void submit(){
      //doSth
      FacesContext.getCurrentInstance().addMessage("submit", new FacesMessage(FacesMessage.SEVERITY_INFO, "Info ", "Info"));
      }
      

       

      But the message doesn't appear. What is wrong?

       

      Best regards