Hello,
I am stucked wtih a problem for 2 days. I have a custom component which extends CustomField class. this component opens a modal panel to select a value, then i call component’s setValue to store selection. Here i get the exception below:
Caused by: com.vaadin.data.Property$ReadOnlyException: null
at com.vaadin.data.util.MethodProperty.setValue(MethodProperty.java:663) ~[vaadin-6.7.3.jar:6.7.3]
at company.project.ui.Chooser$1.valueBind(Chooser.java:23) ~[Chooser$1.class:na]
at sun.reflect.GeneratedMethodAccessor305.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_21]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_21]
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512) ~[vaadin-6.7.3.jar:6.7.3]
... 70 common frames omitted
i tried to manually setReadOnly to false, but not helped.
Any advice?
Thanks
@Override
public void setValue(Object newValue) throws ReadOnlyException, ConversionException {
avoidReadOnlyException();
super.setValue(newValue);
}
private void avoidReadOnlyException() {
super.setReadOnly(false);
Property propertyDataSource = getPropertyDataSource();
if(propertyDataSource!=null)
{
propertyDataSource.setReadOnly(false);
}
}