Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't bind a nested property along a BeanFieldGroup
    primarykey
    data
    text
    <p>I'm developing a vaadin application and now have the following trouble. I'm trying to bind a nested property along BeanFieldGroup.</p> <p>MyEntity Class</p> <pre><code>@Entity public class MyEntity implements Serializable { private static final long serialVersionUID = 1L; @EmbeddedId private MyEntityPK id; //Others Property public MyEntityPK getId() { return this.id; } public void setId(MyEntityPK id) { this.id = id; } } </code></pre> <p>MyEntityPK Class</p> <pre><code>@Embeddable public class MyEntityPK implements Serializable { @Column(name="CD_VARIABILE") private String cdVariabile; public String getCdVariabile() { return this.cdVariabile; } public void setCdVariabile(String cdVariabile) { this.cdVariabile = cdVariabile; } } </code></pre> <p>MyVaadinPanel</p> <pre><code>private BeanFieldGroup&lt;MyEntity&gt; binder; binder = new BeanFieldGroup&lt;MyEntity&gt;(MyEntity.class); binder.setItemDataSource(new BeanItem&lt;MyEntity&gt;(new MyEntity())); variabileBinder.bind(new TextField(), "id.cdVariabile"); </code></pre> <p>When, I try to bind the property "id.cdVariabile" to TextFiel, I get the following error:</p> <pre><code>Caused by: com.vaadin.data.util.MethodProperty$MethodException at com.vaadin.data.util.NestedMethodProperty.getValue(NestedMethodProperty.java:205) at com.vaadin.data.util.TransactionalPropertyWrapper.getValue(TransactionalPropertyWrapper.java:73) at com.vaadin.ui.AbstractField.getDataSourceValue(AbstractField.java:299) at com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:629) ... 48 more Caused by: java.lang.NullPointerException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.vaadin.data.util.NestedMethodProperty.getValue(NestedMethodProperty.java:201) ... 51 more </code></pre> <p>Where am I wrong ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload