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.
Limitation when expanding properties for subclasses
Hello,
I recently discovered Vaadin, and I must admit it is a great framework. However, like in most Java web application frameworks, there is one widget that is missing for me: a property grid like in .NET (see http://msdn.microsoft.com/en-us/library/aa302326.aspx). Some frameworks offer a bean editor, but most of the time this is rather primitive.
So I decided to develop my own widget, and hopefully some day I can add it to the Directory for the community. The BeanItem has an extendproperty method that fits my needs, but I also need to drill down (to show the nested properties X levels deep). Vaadin 7 offers Nested properties, but this new functionality has a limitation (see below) that I cannot get around. So I opened a ticket 8 weeks ago and I included a patch, but until now nobody responded to it. Probably I did something wrong when registering the ticket, so hopefully someone can help me out reviewing it.
http://dev.vaadin.com/ticket/8457
To summarize the problem from the ticket: suppose I have following two classes:
public class ClassA {
private boolean fieldOfClassA;
}
public class ClassB extends ClassA {
private boolean fieldOfClassB;
}
These are used to type a field in another class:
public class ClassC {
private ClassA fieldOfClassC = new ClassB();
}
When I expand an instance of ClassC (after wrapping it in a BeanItem) in my property grid, I see following fields:
- fieldOfClassC
+----fieldOfClassA
However, I expected to see also the fields of the subclass B:
- fieldOfClassC
+----fieldOfClassA
+----fieldOfClassB
So the field of subclass B isn't expanded, since Vaadin is looking at the type of the reference variable (which is ClassA), while it should look at the referenced value (which is ClassB ) if not null.
I have added a patch in my ticket, and it seems to work fine in my local Vaadin version. However, I might have forgotten something...
Thanks in advance for helping me out !
Bart Butenaers
Could you include the link to the ticket. It would be easier to find.
Hey Johannes, thank you for responding to my thread. I have included the links in my original post above, a couple of days ago. Don't hesitate to contact me for further information about the patch I added to ticket 8457.
I still have lot of work developing my property-grid widget, but it is becoming more and more mature. And I think it would be an added value for quite a lot of developers. But I really need my patch to be implemented in Vaadin 7, otherwise I can redirect my property-grid widget straight to the recycle bin :-(
Hope to hear from you guys soon!
Greetings from Belgium,
Bart