Question on Select control with bean collection...

Hi,

I have one doubt regarding “Select” control. Basically i have a collection of beans (Users - User beans). I Created an IndexedContainer using my collection object.

And set this container as a data source object to the select control. I was able to see my select control in the page with some data.

But here my problem is, if I click on the select control I need to show the user name. Now the user bean object’s key is being shown.

How to solve this problem. Could any one help me on this?

Another Question:
is it possible to get the user bean object based on the current item selection?

Thanks in advance,
Thamizharasu S

If you have a collection of beans you are probably best off using BeanItemContainer. BeanItemContainer uses the bean as the itemId so select.getValue() returns the bean.

See
AbstractSelect.setItemCaptionMode
for how to select what is displayed in the select.

Hi Artur,

Thanks for your advice. After passing my bean collection to BeanItemContainter this is working fine. Once again thanks for your timely help :wink:

Thanks,
Thamizharasu S