1 Reply Latest reply on Feb 18, 2009 12:57 PM by blabno

    Problem with calls methods

    jzafrilla.tecnico.antswayofworking.es

      Hi all,
      I have a search form, which uses hibernate-search. I created a component called SearchManager, which gets the list of terms found. My problem is that when i press the search button, repeating the call many times!
      I have just one call to getResultList () in my DataTable. Why is executed several times the call? How can I fix this?


      Thx.

        • 1. Re: Problem with calls methods
          blabno

          Datatable value attribute may be evaluated several times. Use lazy initialization :



          class SearchManager {
          
              List results;
          
              public List getResultList() {
                  if( results == null ) {
                       results = realGetResults();
                  }
                  return results;
              }
          }




          Or use @DataModel.