about NativeSelect,plz help me....

			if (dataCacheable != null) {
				List<KeyValuePair> list = dataCacheable.getKeyValueList(fi.getCodeTable());
				list.add(0,new KeyValuePairImpl("", "--choose--"));

but the “–choose–” option does not displayed.
see the code below:

            if (!isNullSelectionAllowed() && id != null
                    && id.equals(getNullSelectionItemId())) {
                // Remove item if it's the null selection item but null
                // selection is not allowed

tell me how to …
i wanna display the empty option and null can not be allowed!
btw:create a subclass and override the function AbstractSelect.paintContent?

selection.setNullSelectionAllowed(false) hides the null selection option, as you have noticed. I don’t think you can achieve what you want with NativeSelect, but have you tried ComboBox? With that you could put the “–choose–” as the input prompt instead of one of the items.

Anna Koskinen ,thks a lot.
according to the request,we can not use the combox in our project.
in fact, the emtpy option was added to the nativeselect component automaticly,see the js code below:

		},"can not be empty."],"v":{
// look at here,the default value is empty string,so the client engin added the empty option to the nativeselect automaticly?.may i replace the default emtpy option with specified option like "--choose--", and how do it?

The way I understand it, an empty item is added if there is no initial selection, even if you have setNullSelectionAllowed(false), but once you select something that empty item is removed from the list. To my knowledge there is no possible way to leave items visible but not selectable using NativeSelect, or any similar Vaadin component at the moment. Input prompt is what I have used as a workaround, but not every component has it as an option. It’s possible that you might be able to create that functionality yourself by overriding something, but I haven’t tried to do that myself so I can’t say if or how it would work. It might not be anywhere close to trivial.

thks for ur response.