3 Replies Latest reply on Oct 4, 2013 3:26 AM by mkouba

    Conditional observer methods with JSF 2.2

    stefan.lechner

      We have created a observer method with the IF_EXISTS on a CDI Bean.

       

      public void onKeyValueChanged(@Observes(notifyObserver = Reception.IF_EXISTS) @KeyValueChangedEvent final Set<String> event) {

         :

        }

       

      The idea was to have, in combination with JSF2.2, only those beans notified that are in the current view scope.

      While testing we found, that the beans with the observer methods are created, even if they don't exists in the view.

       

      We testet several versions but found always the same behaviour.

       

      For now we have the following configuration.

       

      <cdi.api.version>1.1</cdi.api.version>

      <jsf.api.version>2.2.3</jsf.api.version>

      <weld.api.version>2.1.CR1</weld.api.version>

      <weld.core.version>2.1.0.Beta2</weld.core.version>

       

      I wonder if this is a JSF or a WELD problem, any hints on this ?

       

      brgds

      Stefan