vaadin / vaadin/spring

Spring @EventListener support in component

Open
#272 5 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement investigation
Dominant language
Java
Stars
186
Forks
98
PR merge metrics
No merged PRs in 30d

Description

@heruan commented on Wed Jan 03 2018

When building a PWA with Flow and Spring, I'd like my components able to react on server events using Spring's @EventListener and @TransactionalEventListener. For example:

@Route("users")
public class UserList extends Grid<User> {

    // ...

    @EventListener
    public void onNewUser(NewUserEvent event) {
        UI.getCurrent().access(getDataProvider()::refreshAll);
    }

}

At the moment it seems like @EventListener-annotated methods in @Route-annotated components are not invoked when the observed event is published.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names Vaadin @Route components and Spring's @EventListener and @TransactionalEventListener annotations, but no files or tests. Start by tracing how routed components are created and how Spring event listeners are registered, then reproduce the example with a published event. Done means both annotated listener types are invoked on routed components.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.