1 Reply Latest reply on Aug 9, 2006 2:19 PM by pmuir

    Bean access

    urswag

      How have I to call the categoryManager bean. I should call method before the data model is loaded into the table. With the following construction



      xhtml @69,119 binding="#{categoryMangager.updateAssortmentCategories}": Target Unreachable, identifier 'categoryMangager' resolved to null



      I get the error



      <h:dataTable var="category" binding="#{categoryMangager.updateAssortmentCategories}" value="#{assortmentCategories}">
      <h:column>
      <h:outputLink value="">
      <h:outputText value="#{category.description}" />
      </h:outputLink>
      </h:column>
      </h:dataTable>



      The bean code part



      @Stateful
      @Scope(SESSION)
      @Name("categoryManager")
      @Interceptors(SeamInterceptor.class)
      public class CategoryManagerBean implements Serializable, CategoryManager {

      ...

      public void updateAssortmentCategories() {

      if (assortment != oldAssortment) {
      Query query = em.createQuery("from Category c where c.assortment = :assortment");
      query.setParameter("assortment", assortment);
      assortmentCategories = query.getResultList();
      oldAssortment = assortment;
      }
      }

      ...

      }


        • 1. Re: Bean access
          pmuir

          You don't want to use the binding attribute with Seam. Consider using the Factory pattern for your use case. If you need the update to occur for each refresh of the page I would suggest using a stateless scope.