ListSelect with inputPrompt?

To avoid server side hits for static short lists AFAIK we have to use either ListSelect or NativeSelect. We would prefer to use ComboBox with filtering fully on the client side only but I believe that functionality is only available in version 7 in the near future.

I was able to simulate ComboBox using a ListSelect with rows set to 1 but it doesn’t have support for inputPrompt. Setting the caption makes it more difficult to align a ListSelect next to a ComboBox in a horizontal layout.

The first entry is blank. Is it possible to change the “null” item to look like an inputPrompt rather than just a blank string so we can avoid adding captions?

Already tried this but this:

	packageField.setItemCaption(packageField.getNullSelectionItemId(), 'Search by Package')

But this doesn’t work because packageField.getNullSelectionItemId() returns null. It might work if it instead returned a placeholder for Null Object pattern.

    public void setItemCaption(Object itemId, String caption) {
        if (itemId != null) {
            itemCaptions.put(itemId, caption);


To answer my own question this works:

		packageField.setNullSelectionItemId(new Object())
		packageField.setItemCaption(packageField.getNullSelectionItemId(), '--> Search by Package <--')

It’s not quite the same as inputPrompt as it doesn’t haven the grey styling (not does it have a special CSS wrapper) but it’s better than nothing.

Any other options?