TextField setEnabled -> bug Vaadin 6.4?

Hi,

I have an application that ran smoothly on Vaadin 6.3, but when switching to 6.4 something strange happened.
The app has a couple of tabs in a tabsheet. On one of the tabs, there is a Form with a Formfieldfactory. The FormFieldFactory has, besides the mandatory createField()-method, one other public method, called changeSelection(newValue).
This function is used when a NativeSelect on the Form changes value. So on the NativeSelect, i have a ValueChangeListener that invokes the changeSelection()-method.

The changeSelection()-method enables/disables another TextField on the same Form.

However, during construction-time (when the app is first displayed to the user), i allready want to invoke that changeSelection()-method with a default selected item, so that the TextField is enabled/disabled just like i want it. So what i do, is calling the changeSelection()-method at the very end of the constructor of the Form (the Form is a component that i have written myself and that extends Form) that is associated with the FormFieldFactory (again this is something i written myself and extends DefaultFieldFactory). And this is were things go wrong.

During construction time, nothing is wrong, the Form is build up correctly without any (server-side) errors. However when switching the first time to the tab with the Form, the browser just hangs. I’ve tried to add the ‘?debug’ to the url of my app, and then is see following error when i switch to the tab with the Form:
“java.lang.UnsupportedOperationException: Add not supported on this list”, but with no further information…

When leaving out the piece of code in the changeSelection()-method that disables the TextField, no errors occur, so this seems like a bug to me…

Any ideas?

Regards,
Jan

Hi,

Quite hard to guess based on that story. There is quite a lot of changes in 6.4. A code example might help to help you.

cheers,
matti

Hello, i’ve got the same error with vaadin-6.4.0
Here is example:


public class New extends com.vaadin.Application {
    
    @Override
    public void init() {
        TextField totalF = new TextField("Total:");
        totalF.setEnabled(false);
        totalF.setStyleName("my-disabled");
        /*
         .my-disabled {
            opacity: 1;
            filter: none;
        }
         */

        FormLayout totalFL = new FormLayout();
        totalFL.addComponent(totalF);

        VerticalLayout vl = new VerticalLayout();
        vl.addComponent(totalFL);

        Window mainW = new Window("Test window");
        mainW.addComponent(vl);
        setMainWindow(mainW);
    }

Thanks, it looks to be a regression from #4997. I’ll fix if for tomorrows nightly.

cheers,
matti