Project

General

Profile

Actions

bug #7910

closed

TeamOrPersonField: readonly exception on bindig data

Added by Andreas Kohlbecker about 4 years ago. Updated about 4 years ago.

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

100%

Estimated time:
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 collectionsClosedAndreas Kohlbecker

Actions
Related to EDIT - bug #8217: ToManyRelatedEntitiesComboboxSelect edit button not enabled ClosedAndreas Kohlbecker

Actions
Actions #1

Updated by Andreas Kohlbecker about 4 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 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

Actions #2

Updated by Andreas Kohlbecker about 4 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?

Actions #3

Updated by Andreas Kohlbecker about 4 years ago

Actions #4

Updated by Andreas Kohlbecker about 4 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.

Actions #5

Updated by Andreas Kohlbecker about 4 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.

Actions #6

Updated by Andreas Müller about 4 years ago

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

Updated by Wolf-Henning Kusber about 4 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.

Actions #8

Updated by Andreas Kohlbecker about 4 years ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Andreas Kohlbecker almost 4 years ago

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

Also available in: Atom PDF