addGeneratedColumn fails with null exception when used against existing column

Using the DataGrid.addGeneratedColumn fail with a null exception when running it against an existing column. Tracing the code, it fails when it attempts to remove the existing column to replace it with the new one. If a new column name is used, it works as expected.

Hi,

Do you use cuba.testMode=true?

Regards,
Gleb

yes, does this affect it? we have it on for automated testing.

turned off test mode I get this error:
ConcurrentModificationException
any idea why?
nevermind, figured out it was due to my iteration over the columns in the datagrid. due to the columns changing (getting removed and replaced) it causes the concurrency issues.

Hi,

Yes, NPE is caused by cuba.testMode and this issue is already fixed and will be published in the very next bug fix release.

As for ConcurrentModificationException, unfortunately, I cannot reproduce the problem. I will be able to help you if you send a small sample project along with reproduction scenario that demonstrates the issue.

Regards,
Gleb

Thanks, I’ll run it without test mode till the fix is in. I figured out the concurrency issue, it was due to me iterating through the datagrid columns looking for ASSOCIATION and COMPOSITION fields to change (I’m converting them to link fields as DataGrid doesn’t support Link like Tables do), unless there is an alternative to this. We don’t want to use Table as we prefer the inline editing of the Data grid, and the lazy loaded nature of the grid.

Did you use the com.haulmont.cuba.gui.components.DataGrid.ClickableTextRenderer or something else?

No I generated a LinkButton to do the task, I’ll try out the ClickableTextRenderer.