2 Replies Latest reply on Feb 1, 2008 10:56 AM by rajesha Indurthi

    action invoked by an ajax button .

    rajesha Indurthi Newbie

      Hi,
      I have an ajax button inside a simpletogglepanel as shown below:
      <rich:simpleTogglePanel switchType="client" label="Save Search Query Tag" opened="false">
      <h:inputText value="#{oneLineSearchBean.searchStringName}" />
      <a4j:commandButton value="SaveQuery" styleClass="regularButton" action="#{oneLineSearchBean.saveSearch}"/>
      </rich:simpleTogglePanel>
      The saveSearch method of my oneLineSearchBean is as shown below.

      public String saveSearch()
      {
      System.out.println("sssssssssssss--------Iam here the second time");
      SearchQueryObject searchQueryObj = buildSearchQueryObject();
      Dao searchSaveDao = (BasicHibernateDao) SpringContextHolder.ctx().getBean("entityFinder");
      Long id = searchSaveDao.saveQuery(searchQueryObj);
      System.out.println("The stored Query record id is :"+id );
      this.setSearchStringName("Enter Tag Here");
      FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,"The search query tag is saved.",""));
      return null;

      }

      As it can be seen in the facesContext Iam setting a message called the search query is saved, but when thejsp gets invoked, the message is not displayed.
      Can any one let me kow what is happening here..what should I do to display that message to the user on completing that saveSearchAction.

      any help on this will appreciated .
      Thanks in advance!!!