vaadin / vaadin/framework

ComboBox throws ReadOnlyException in case of change value during some long request

Open
#7,293 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Originally by artamonov


I have button that performs some long operation and ComboBox. Button sets readonly true to ComboBox and performs long operation synchronously. During operation user can change value of ComboBox, in this case ReadOnlyException will be thrown.

If I use TextField instead of ComboBox then this case works fine. I have compared source code of AbtractTextField#changeVariables and ComboBox#changeVariables, there is additional check for !isReadOnly in AbstractTextField:185

if (variables.containsKey("text") && !isReadOnly()) {

I have tried this check with our custom ComboBox and this works fine. TestUI attached.

Steps to reproduce:

Click on Test button

Long request will start

Click on ComboBox drop down button (may be twice)

Select new value

Red indicator with ugly stacktrace on ComboBox will be shown


Imported from https://dev.vaadin.com/ issue #19238

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

Compare ComboBox#changeVariables with AbstractTextField#changeVariables, focusing on the read-only handling described in the issue. Reproduce the case with the attached TestUI by starting the long request and changing the ComboBox; done means the interaction no longer produces a ReadOnlyException or red error indicator.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.