vaadin / vaadin/framework

Grid - ComponentRenderer - allow adding click listeners

Open
#10,237 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Situation
We use ComponentRenderer in a grid to render custom components in a cell (f.e. an Image followed by a Label wrapped in a HorizontalLayout).
Problem
The only problem is the grid allows selection but the custom components do not 'forward' the selection to the grid. I tried doing this without changes to the vaadin framework but did not succeed. The problem was getting the clicked row when adding a context click listener to the custom component.
Proposed solution
This could be solved but allowing click listeners on the ComponentRenderer where the click event has the item of the row (like the ButtonRenderer has f.e.), so basically letting ComponentRenderer(Connector) extend from ClickableRenderer(Connector).

FYI: I forked the vaadin-framework ,worked on this and will submit a Pull request.

Regards
Jeno

Contributor guide

Open the contributing guide

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

Start by comparing ComponentRenderer and ComponentRendererConnector with ClickableRenderer and ClickableRendererConnector, using ButtonRenderer as the example for row-aware click events. Trace how Grid selection and context clicks reach custom components, then verify that ComponentRenderer click events expose the rendered row item and forward selection appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.