@Factory("nodes") public void findNodes() { StringBuffer q = "FROM Node"; if(searchManager != null) q = "FROM Node WHERE name LIKE '%" + searchManager.getQueryString() + "%'"; nodes = em.createQuery(q).getResultList(); }
The problem I face is this: - in the search() method of SearchManagerBean, the value of queryString is useable - however, when searchManager.getQueryString() is called from the @Factory method in NodeManagerBean, the searchManager instance that has been injected says that the parameter is null
One solution I found was making the SearchManagerBean scope CONVERSATION, however, this means that the search parameter is used every time the nodeList is fetched - that is not what I want. I only want the parameters to hang around for long enough to render the page.
I also tried encapsulating the queryString in another JavaBean, with scope PAGE, that didn't work either.