Project

General

Profile

bug #7910

TeamOrPersonField: readonly exception on bindig data

Added by Andreas Kohlbecker 5 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Highest
Category:
cdm-vaadin
Target version:
Start date:
11/15/2018
Due date:
% Done:

100%

Severity:
normal
Found in Version:
Tags:

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

Related to Edit - feature request #7600: public setters for entity collections Closed 07/30/2018
Related to Edit - bug #8217: ToManyRelatedEntitiesComboboxSelect edit button not enabled Closed 04/02/2019

Associated revisions

Revision 64bf3ea5 (diff)
Added by Andreas Kohlbecker 5 months ago

ref #7910 ToManyRelatedEntitiesListSelect: no longer setting readlony on nested fields

Revision ea92bdaa (diff)
Added by Andreas Kohlbecker 5 months ago

ref #7910 TeamOrPersonField adapting read only state handling to available teammebers setter

History

#1 Updated by Andreas Kohlbecker 5 months 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 PropertyDataSourcebeing 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

#2 Updated by Andreas Kohlbecker 5 months 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?

#3 Updated by Andreas Kohlbecker 5 months ago

#4 Updated by Andreas Kohlbecker 5 months 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.

#5 Updated by Andreas Kohlbecker 5 months 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.

#6 Updated by Andreas Müller 5 months ago

  • Subject changed from TermOrPersonField: readonly exception on bindig data to TeamOrPersonField: readonly exception on bindig data

#7 Updated by Wolf-Henning Kusber 3 months ago

  • Assignee changed from Wolf-Henning Kusber to Andreas Kohlbecker
  • % Done changed from 50 to 100

Habe keine Funktionsfehler mehr festgestellt. Kann geschlossen werden.

#8 Updated by Andreas Kohlbecker 3 months ago

  • Status changed from Resolved to Closed

#9 Updated by Andreas Kohlbecker 23 days ago

  • Related to bug #8217: ToManyRelatedEntitiesComboboxSelect edit button not enabled added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)