Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
How to reference an object in the Field Factory class?
I have a question about Custom Field Factory.
I have a CustomFieldFactory class which extends DefaultFieldFactory class.
the BeanItem is created from a class which contains a reference to another class
public class MyClass {
private int field1;
private SomeObject myClass;
...
...
...
...
...
public class SomeObject {
int nameId;
String name;
...
...
...
...
My question is how do I reference the SomeObject.nameid field in the Custom Field Factory?
for the 'field1' in the CustomFieldFactory I would code like this
if (propertyId.equals("field1")) {
but how do I refrerence the myClass.nameid field in the CustomFieldFactory?
Thank You
Peter
Hi,
If you just have a private field w/o getter, that will be a pita.
However, assuming you have a getter so that you can get your object, you'll want to use BeanItem.getBean() to get the underlying object, then access whatever you want.
Best Regards,
Marc