2 Replies Latest reply on Jun 22, 2012 9:54 AM by croco

    Push error message in modalPanel from backing bean

    croco

      I have a problem showing error message in modal panel. I have a modal panel and an action button. If action fails I want to show an error message in modalPanel.

       

       

      <rich:modalPanel id="modalPanel">
           <h:form id="modalPanelForm">     
                <someComponents/>
                <a4j:commandLink id="modalPanelActionLink action="backingBean.action()" />
                <a4j:outputPanel ajaxRendered="true">
                     <h:message for="modalPanelActionLink" />
                </a4j:outputPanel>
           </h:form>
      </rich:modalPanel>
      

       

       

      @Name("backingBean")
      class BackingBean {
           public void action() {
                ... here something went wrong and ...
                FacesMessage message = new FacesMessage("Something went wrong");
                FacesContext.getCurrentInstance().addMessage("modalPanelForm:modalPanelActionLink, message);
           }
      }
      
      

       

      This should be working but in modal panel is not. Where I'm making a mistake?