Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDI: Allow listing to PhaseEvents via @Observes #1443

Closed
eclipse-faces-bot opened this issue Mar 31, 2017 · 11 comments
Closed

CDI: Allow listing to PhaseEvents via @Observes #1443

eclipse-faces-bot opened this issue Mar 31, 2017 · 11 comments
Labels
Milestone

Comments

@eclipse-faces-bot
Copy link

eclipse-faces-bot commented Mar 31, 2017

DeltaSpike has a way to catch PhaseEvents via @Observes:
https://deltaspike.apache.org/documentation/jsf.html#Eventbroadcasting
See AfterPhase / BeforePhase

It would be great to have this, however this requires that PhaseId values are Enums.

Example:

public void onPhaseStart(@Observes @BeforePhase(PhaseId.ANY_PHASE) PhaseEvent event) {
    //...
}

public void onPhaseEnd(@Observes @AfterPhase(PhaseId.RENDER_VIEW) PhaseEvent event) {
    //...
@eclipse-faces-bot

This comment was marked as off-topic.

@eclipse-faces-bot

This comment was marked as off-topic.

@eclipse-faces-bot

This comment was marked as off-topic.

@eclipse-faces-bot

This comment was marked as off-topic.

@yaminikb yaminikb removed their assignment Feb 18, 2022
@tandraschko tandraschko changed the title CDI improvements: Allow listing PhaseEvents via @Observes CDI: Allow listing PhaseEvents via @Observes Jun 11, 2024
@tandraschko tandraschko changed the title CDI: Allow listing PhaseEvents via @Observes CDI: Allow listing to PhaseEvents via @Observes Jun 11, 2024
@tandraschko
Copy link

Easy implemented prototype here: tandraschko/myfaces@63a3fe8

please review @BalusC @arjantijms @pizzi80 @melloware

@melloware
Copy link

This looks good I have used my own custom one for years!

@BalusC
Copy link
Member

BalusC commented Jun 15, 2024

Oh cool. Let's do it for 5.0. I like you took the opportunity to finally turn the PhaseId into an enum.

@BalusC BalusC added this to the 5.0 milestone Jun 15, 2024
@tandraschko
Copy link

done in myfaces: apache/myfaces@c30922c

@tandraschko
Copy link

i really like how easy those both CDI enhancements was to implement and its a great benefit for users

@BalusC
Copy link
Member

BalusC commented Sep 2, 2024

@tandraschko how about ANY_PHASE and the firing order relative to existing phase listeners? Is the behavior as documented in https://github.com/jakartaee/faces/pull/1965/files and as asserted by this integration test acceptable/intuitive? https://github.com/jakartaee/faces/pull/1966/files#diff-6df6ff3e53a0b081d16b1becf2816939412c977ce2d9e20d1b93e35524933255R38

BalusC added a commit that referenced this issue Sep 2, 2024
@tandraschko
Copy link

The order is a good question; i didnt care about it and just registered it in the jsf-impl faces-config.xml

@BalusC BalusC added the mojarra-implemented API issue implemented by Mojarra label Sep 5, 2024
@BalusC BalusC closed this as completed Sep 5, 2024
BalusC added a commit that referenced this issue Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants