Vaadin

Join Vaadin Log In
Combination View Flat View Tree View
Threads [ Previous | Next ]
Disabling writing in Select or ComboBox
toggle
Hi,

Is it possible to disable the writing in a Select or ComboBox component, so that when I click anywhere on the component it would just pop open like a NativeSelect?

// Jonas
Flag Flag
Re:Disabling writing in Select or ComboBox
11/13/08 8:10 AM as a reply to Jonas Granvik.
Currently, no.

Why do you need such functionality? Why not just use NativeSelect then?

I'm just guessing here, but you want it because you need to modify the theme for it, am I right?
Flag Flag
Re:Disabling writing in Select or ComboBox
11/13/08 8:16 AM as a reply to Jonas Granvik.
Actually I have old code which behaves ok with Select or ComboBox, but for some reason NativeSelect is not working ok. Select or ComboBox cannot be used if the write mode can't be switched off.

My problem is the following:
I have four NativeSelects A,B,C,D. C and D are hidden and choosing A activates B and chosing B activates and shows C and D selects. The probelm is that when C and D are activated they look like an empty ComboBox until I manually refresh the page which updated the component to a filled NativeSelect which it should be.
Flag Flag
Re:Disabling writing in Select or ComboBox
11/13/08 9:09 AM as a reply to Jonas Granvik.
they look like an empty ComboBox until I manually refresh

This is actually a bug in the layout (as strange as that might sound).
Feel free to add ticket...

As a workaround, until we get that particular issue fixed in 5.2, it should work if you add C and D when they are needed (instead of adding in advance and unhiding). That is: don't add hidden NativeSelects, only visible ones. This is not an optimal solution, I know, but should work.
Flag Flag
Re:Disabling writing in Select or ComboBox
11/13/08 9:56 AM as a reply to Jonas Granvik.
Ok, good to know then. I'll just rewrite my code a bit.

Added a ticket about this issue: http://dev.itmill.com/ticket/2203

Thanks for the answer,
// Jonas
Flag Flag