Simon Kitching wrote:
It looks like the custom MyEvent class would need to override a number of the FacesListener methods, eg isAppropriateListener.

This does seem to me to be a reasonable feature for tomahawk, perhaps called t:valueChangeNotifier or as you say a phase attribute on a t:valueChangeListener. Having a phase is a little odd, though, as the ValueChangeListener declares that it throws AbortProcessingException (ie can report a validation failure) but this has no meaning after the model update phase.
Yes, and it will solve my second problem with the current valueChange behaviour.

If you change a value in your bean - which is the value of another component with an valueChangeListener, this component will fire a valueChange event too. IMHO this is bad too, I (the code) changed the value not the GUI, so I dont want to see any event for this. I use AbortProcessingException as workaround, but, well, I feel not very comfortable with it.

So what to do next.

We create a t:valueChangeNotifier which will add a valueChangeListener which does nothing else than collect all valueChange events in an list (request scoped?). Then (I guess) we will need a PhaseListener which fires all collected events after UPDATE_MODEL.

t:valueChangeNotifier should be able to use a ValueChangeListener class or method. We still can use the AbortProcessingException to abort any further valueChange event processing just to fullfill the interface contract, though, it might be very unlikely that one uses it.

Comments?

Ciao,
Mario

Reply via email to