Problem with Drop-down (Select)...

Hi all,

I have a drop-down (Select) & I have 3 items in it as follows.

BeanItemContainer<String> container = new BeanItemContainer<String>(String.class);
container.addItem("Topic 1");
container.addItem("Topic 2");
container.addItem("Topic 3");

Select myselect= new Select("Select a topic to read : ", container);
myselect.setImmediate(true);
myselect.addListener(new Property.ValueChangeListener() {
    public void valueChange(ValueChangeEvent event) {
        System.out.println("Selected topic = " + (String)myselect.getValue());
    }
});

I need to print the SELECTED INDEX[something like
myselect.getSelectedIndex()
] upon ValueChangeEvent.
How do I achieve this…???

Thanks in advance,
Asela.

This has been answered previously in
this thread
.