Combobox valueChangeListener problem

Hi

First, the code

ComboBox backendResource = null;
for (final Map.Entry entry : backendCategorizedResources.entrySet()) {
    final Collection<ResourceDetails> resourceIdNames =
        (Collection<ResourceDetails>) entry.getValue();
    backendResource = new ComboBox((String) entry.getKey(), resourceIdNames);
    backendResource.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        @Override
        public void valueChange(final ValueChangeEvent event) {
            LOG.debug("Value change event");

        }
    });
..

As you can see in the above code that I am creating multiple combox box with different key’s and values taken out from the map. Just after creating the box I am adding a value change listener. The problem I am having is that the value change only get triggered for the last event and not the current event. So, when my web page loads for the first time and I modify the value of the combo box I dont see any log. But when I modify the value of combo box again than I see the log and I also see the event value to be the previous selected element.

Any ideas, any one ?
Thanks

Got the answer. Had to set the setImmediate to true.