datenhahn / componentrenderer

A ComponentRenderer for the Vaadin Grid
Apache License 2.0
6 stars 8 forks source link

Conflict between rendered checkbox and editor checkbox #16

Closed guttormvik closed 8 years ago

guttormvik commented 8 years ago

In your "Classic Grid with Decorator" demo: Without the editor open, I can click the "Premium Kunde" checkboxes as expected. With the editor open I can click on the "Premium Kunde" in the editor as expected.

But: With the editor open, if I click on a "Premium Kunde" checkbox outside the editor, that checkbox is clicked OK, but then the editor is moved on top, and in the editor the checkbox shows with the old state.

Possible solutions:

For my use-case, (only use ComponentRenderer for checkboxes and buttons) I think I'd prefer the editor to be closed.

guttormvik commented 8 years ago

Similar problem with UploadField; If I click on an UploadField outside the editor and the editor is moved, I do get the file chooser, but not the file. At least the valueChanged listener on the UploadField property doesn't fire.

I see that getValue is called multiple times. Is the problem that Vaadin "redraws" the grid cell that I just clicked on, and then ignores further events on the original field?

Overriding UploadField and adding debug to construction and detach, I see that when I create a new row and display the button for the first time, I get 1 call to constructor. When I click on it, I get 4 new calls to the constructor and 1 detach on the initial instance.

guttormvik commented 8 years ago

Btw, I did a test where I rendered everything in one of our editable lists with ComponentRenderer. That was a bit slow in Chrome, and really painful in IE, even with sizes set on both the column and the individual fields.

So; To use ComponentRenderer at all we do need to let the Grid Editor handle regular fields, and limit ComponentRenderer to a smaller number of Checkboxes, buttons etc.

Since ComponentRenderer currently doesn't play well with the Grid Editor, I can't use it.

datenhahn commented 8 years ago

Hi, sorry, I just saw the issue ticket, seem to have missed the mail-notification. Can you provide me with some code examples for the cases of the editor problems and the grid which renders very slowly? I am very interested in these realworld use issues, thanks

datenhahn commented 8 years ago

regarding the checkbox, see 1.0.0beta2, it should fix the problem that the editor is moved to the row where the "outside-checkbox" was clicked, and thous preventing getting an editor field with the old value

datenhahn commented 8 years ago

it probably also fixes the problem with the upload field, can you check it in your code?

datenhahn commented 8 years ago

Btw, I did a test where I rendered everything in one of our editable lists with ComponentRenderer.

How many columns did you have and what where the components you used? In case of ComboBoxes, how many elements where in the list?

The drawback of the full blown components is that they render slower than specialised widgets (that was one of the reasons vaadin did decide to introduce the GWT-renderers). So rendering part with default renderers and part with the componentrenderer usually is the way to go.

guttormvik commented 8 years ago

I've now added the 1.0.0beta2 ComponentRenderer back to our application, and it does seem to work now.

However, with just a few checkbox columns I think I can already notice that IE is becoming more sluggish. This would indicate that ComponentRenderer is something that we have to use sparingly.

Your online demo seems to be OK in IE. I assume that the difference is that our application has a lot more layout levels and components around the grid.

Unfortunately it isn't practical to give you an actual example screen from our application; You would have to get most of the application and the database too.. :)