[REVIEW REQUEST] Add support for an emptyText property in ComboBox

Jonathan Giles jonathan.giles at oracle.com
Tue Feb 26 12:10:06 PST 2013


I'm happy to remove the newly-added ComboBox.emptyText and replace it 
with ListView.placeholder and ComboBox.placeholder. I've spoken to 
Richard about it and he is happy too, but I'll await a formal +1 before 
going ahead and making that change.

-- Jonathan

On 21/02/2013 12:09 p.m., Philipp Dörfler wrote:
> I support the idea of a consistent placeholder node for controls. A good example for this is Scene Builder which shows a "Drag Library items here..." or Google Drive on Android which avoids a blank white screen by placing a "You don't have any items in your library" (Something like that) along with a nice large icon.
> Given that nowadays with the rise of web apps users tend to interpret large white areas as an error, something which isn't loading, I favor the placeholder node. Given that a placeholder text property would itself end up being converted to a Text (or Label for that matter) anyways, I'd welcome the additional flexibility to show an image or something else.
>
> Regarding increase of complexity: True, there is a slight increase. However: The use of placeholder nodes - while being a common use case - is not something one has to face in order to use the controls basic functionality. You can still use a ListView, Table, etc. while not caring about the placeholder. Besides: placeholderNode or just placeholder is a reasonable name which perfectly suggests what it is about so I would be surprised if anyone had difficulties understanding it.
>
> Just my six cent,
> ~ Philipp
>
> Am 20.02.2013 um 20:00 schrieb Jonathan Giles <jonathan.giles at oracle.com>:
>
>> Conceptually I have no issue with the use of a placeholder Node property being used instead of an emptyText String property - I like the consistency across the controls. The only (slight) concern is the increased complexity for the common use case: you go from comboBox.setEmptyText("empty!!") to comboBox.setPlaceholder(new Label("empty!!")).
>>
>> I'll leave it up for discussion, but as of now the status quo is emptyText.
>>
>> -- Jonathan
>>
>> On 20/02/2013 11:03 p.m., Knut Arne Vedaa wrote:
>>>
>>> Scott Palmer wrote:
>>>> What about consistency with TableView?
>>> TableView has:
>>>
>>> ObjectProperty<Node>     placeholder
>>> This Node is shown to the user when the table has no content to show.
>>>
>>> ListView doesn't, but I think it should. It means "no items", and both TableView and ListView has an "items" list, thus it is analogous.
>>>
>>> ComboBox could then just utilize its ListView's placeholder, instead of introducing another "empty" concept.
>>>
>>>
>>> Knut Arne Vedaa



More information about the openjfx-dev mailing list