bug #7910
closedTeamOrPersonField: readonly exception on bindig data
100%
Description
Caused by: com.vaadin.data.Buffered$SourceException at com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:664) at com.vaadin.data.fieldgroup.FieldGroup.bind(FieldGroup.java:273) at com.vaadin.data.fieldgroup.BeanFieldGroup.bind(BeanFieldGroup.java:155) at com.vaadin.data.fieldgroup.FieldGroup.bindFields(FieldGroup.java:113) at com.vaadin.data.fieldgroup.FieldGroup.setItemDataSource(FieldGroup.java:103) at com.vaadin.data.fieldgroup.BeanFieldGroup.setItemDataSource(BeanFieldGroup.java:126) at eu.etaxonomy.cdm.vaadin.component.common.TeamOrPersonField.setInternalValue(TeamOrPersonField.java:205) at eu.etaxonomy.cdm.vaadin.component.common.TeamOrPersonField.setInternalValue(TeamOrPersonField.java:1) at com.vaadin.ui.AbstractField.setValue(AbstractField.java:526) at eu.etaxonomy.cdm.vaadin.component.common.TeamOrPersonField.setValue(TeamOrPersonField.java:387) at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.updateAuthorshipFieldData(TaxonNamePopupEditor.java:658) at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.updateAuthorshipFields(TaxonNamePopupEditor.java:588) at eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor.lambda$13(TaxonNamePopupEditor.java:681) at sun.reflect.GeneratedMethodAccessor199.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510) ... 98 more Caused by: com.vaadin.data.Property$ReadOnlyException at com.vaadin.ui.AbstractField.setValue(AbstractField.java:493) at com.vaadin.ui.AbstractField.setValue(AbstractField.java:468) at com.vaadin.ui.AbstractField.setValue(AbstractField.java:453) at eu.etaxonomy.cdm.vaadin.component.common.PersonField.setValue(PersonField.java:280) at eu.etaxonomy.cdm.vaadin.component.common.PersonField.setValue(PersonField.java:1) at eu.etaxonomy.vaadin.component.ToManyRelatedEntitiesListSelect.createFieldsForData(ToManyRelatedEntitiesListSelect.java:270) at eu.etaxonomy.vaadin.component.ToManyRelatedEntitiesListSelect.setInternalValue(ToManyRelatedEntitiesListSelect.java:246) at eu.etaxonomy.vaadin.component.ToManyRelatedEntitiesListSelect.setInternalValue(ToManyRelatedEntitiesListSelect.java:1) at com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:657) ... 114 more
Related issues
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from New to In Progress
The root of this problem is the Team class in which the setter for members is protected
. This causes the PropertyDataSource
being readonly due to the missing setter for this bean property.
The TermOrPersonField already has a hacky workaround to allow modifying the team members anyway:
fieldGroup.setItemDataSource(new BeanItem<Team>((Team)newValue)); // <<NEW PROBLEM
boolean readonlyState = personsListEditor.isReadOnly();
fieldGroup.bind(personsListEditor, "teamMembers"); // here personField is set readonly since setTeamMembers does not exist
personsListEditor.setReadOnly(readonlyState); // fixing the readonly state
But now a ReadonlyException already occurs at the line marked with // <<NEW PROBLEM
if the internal value has been set before
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Andreas Kohlbecker to Andreas Müller
- Priority changed from New to Highest
- % Done changed from 0 to 10
The preferred solution to this is making the setTeamMembers()
in Team public
Are you ok with this Andreas Müller?
Updated by Andreas Kohlbecker over 5 years ago
- Related to feature request #7600: public setters for entity collections added
Updated by Andreas Kohlbecker over 5 years ago
- Assignee changed from Andreas Müller to Andreas Kohlbecker
- % Done changed from 10 to 30
I implemented the EntityCollectionSetterAdapter
(#7600) in order to provide a public setter method for teammembers.
The readonly state handling in the TeamOrPersonField
needs to be changed afterwards.
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from In Progress to Resolved
- Assignee changed from Andreas Kohlbecker to Wolf-Henning Kusber
- % Done changed from 30 to 50
Hallo Henning,
Das TeamOrPersonField sollte nun korrekt funktionieren. Bitte teste verschiedene Varianten durch.
Updated by Andreas Müller over 5 years ago
- Subject changed from TermOrPersonField: readonly exception on bindig data to TeamOrPersonField: readonly exception on bindig data
Updated by Wolf-Henning Kusber about 5 years ago
- Assignee changed from Wolf-Henning Kusber to Andreas Kohlbecker
- % Done changed from 50 to 100
Habe keine Funktionsfehler mehr festgestellt. Kann geschlossen werden.
Updated by Andreas Kohlbecker about 5 years ago
- Status changed from Resolved to Closed
Updated by Andreas Kohlbecker about 5 years ago
- Related to bug #8217: ToManyRelatedEntitiesComboboxSelect edit button not enabled added