How to get value of generated table column


I have a Table with a generated column which contains Labels. Having such Table, is it possible to get value from the generated column (in other words, to get exactly what was generated and the user sees)?.


Maybe i am wrong. But table.getItem(itemid).getItemProperty(propertyid).getValue() should do the trick.


Unfortunatelly table.getItem(itemid) returns BeanItem (in my case, since I use BeanItemContainer) and it doesn’t have the generated property… :frowning:


I can’t think of a built-in feature doing exactly what you want, but since you generated the value, you could probably get that value in the same way you generated it?

Best Regards,

Sure, however generating the value is a bit costly (LDAP query), so I wanted to make it in simple and efficient way. Anyway I’ll try to find a workaround (maybe subclassing BeanItemContainer and not using generated columns…)

I also have to handle a very special type of model. The BeanItem/Container also didnt worked for me so i just made my own container and item classes. Since some very needed methods of BeanItem/Container are private subclassing
is not so fancy to do, i think.
For the Item i just extended PropertySetItem wich was quite easy and for the container i didnt extended at all
just implemeted the interfaces. I have to add that i got more model description than the beans reflective one. Now everything is working just fine.


A solution that I’m using is to store the generated componant in a HashMap with the Object used to generated it as the id. This is better than re-generating it because in my case the generated componant can be changed by the user (checkbox).

It will re-generate (and double expensive operations) but maybe it still helps: via getColumnGenerator, you can get the generator - and then feed in the Item you want to have the info for