vaadin / vaadin/framework

Invisible components break grid editor

Open
#12,527 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In Vaadin Framework 8.4.13, when you are registering a component to be used as a grid editor for a column, if that component happens to be invisible, it completely breaks the grid. Reason: CustomEditorHandler's getWidget() method tries to get the editor component by its connector ID. Now, if the connector ID is null, then it correctly renders an empty editor. However, if the connector ID is not null (as is the case with an existing, but invisible component), an attempt is made to retrieve the connector from the id-to-connector map, but the connector is not there (because the server-side code didn't push it as a dirty, but invisible connector), causing a client-side null pointer.

Steps to reproduce: create a editable Grid, register a field as a custom editor for any column, set that field to invisible, try to activate the editor.

Easiest fix is probably splitting EditorConnector::getWidget on line 146 to do a null check on the return of the getConnector() method.

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 in EditorConnector::getWidget around line 146 and review how CustomEditorHandler retrieves the editor connector by ID. Reproduce with an editable Grid using an invisible custom editor field, then verify that activating the editor no longer causes a client-side null pointer and renders an empty editor when the connector is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.