Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo unselect item
Combo unselect item [message #461736] Thu, 29 September 2005 02:52 Go to next message
Brad Reynolds is currently offline Brad Reynolds
Messages: 309
Registered: July 2009
Senior Member
We have the need for the end user to unselect the selection in a
READ_ONLY | DROP_DOWN Combo. We can accomplish this by adding an empty
item in Combo but it has a valid index instead of -1 which would be no
selection. Has anyone found a better way around this? It would be
great if the Combo supported a style that would create this item for us.
Also by having an empty item it forces the indexes between the list
and our model to be off by 1.

Thanks,
Brad
Re: Combo unselect item [message #462016 is a reply to message #461736] Wed, 05 October 2005 01:43 Go to previous messageGo to next message
Steve Northover is currently offline Steve Northover
Messages: 1636
Registered: July 2009
Senior Member
MAybe you should be using an editable combo box then. A read only combo box
can't show text that is not one of the items.

"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:dhfkt7$3p1$1@news.eclipse.org...
> We have the need for the end user to unselect the selection in a
> READ_ONLY | DROP_DOWN Combo. We can accomplish this by adding an empty
> item in Combo but it has a valid index instead of -1 which would be no
> selection. Has anyone found a better way around this? It would be
> great if the Combo supported a style that would create this item for us.
> Also by having an empty item it forces the indexes between the list
> and our model to be off by 1.
>
> Thanks,
> Brad
Re: Combo unselect item [message #462109 is a reply to message #462016] Thu, 06 October 2005 16:10 Go to previous messageGo to next message
Brad Reynolds is currently offline Brad Reynolds
Messages: 309
Registered: July 2009
Senior Member
I tried that but they (functional people) didn't want the end user to be
able to enter a value. The text box gives the user the feel that they
can type in anything which in our case isn't true. They just need to be
able to deselect the value and we end up adding this empty item to do so
everywhere. I thought that others might have this issue as well outside
our company but maybe not.

Steve Northover wrote:
> MAybe you should be using an editable combo box then. A read only combo box
> can't show text that is not one of the items.
>
> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
> news:dhfkt7$3p1$1@news.eclipse.org...
>
>>We have the need for the end user to unselect the selection in a
>>READ_ONLY | DROP_DOWN Combo. We can accomplish this by adding an empty
>>item in Combo but it has a valid index instead of -1 which would be no
>>selection. Has anyone found a better way around this? It would be
>>great if the Combo supported a style that would create this item for us.
>> Also by having an empty item it forces the indexes between the list
>>and our model to be off by 1.
>>
>>Thanks,
>>Brad
>
>
>
Re: Combo unselect item [message #462126 is a reply to message #462109] Thu, 06 October 2005 21:46 Go to previous messageGo to next message
Eclipse User
Originally posted by: friederich.kupzog.de

Hi, my quite large database applications all make use of the "empty
item" and users are absolutely ok with that.
Regards,
Friederich

Brad Reynolds wrote:
> I tried that but they (functional people) didn't want the end user to be
> able to enter a value. The text box gives the user the feel that they
> can type in anything which in our case isn't true. They just need to be
> able to deselect the value and we end up adding this empty item to do so
> everywhere. I thought that others might have this issue as well outside
> our company but maybe not.
>
> Steve Northover wrote:
>
>> MAybe you should be using an editable combo box then. A read only
>> combo box
>> can't show text that is not one of the items.
>>
>> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>> news:dhfkt7$3p1$1@news.eclipse.org...
>>
>>> We have the need for the end user to unselect the selection in a
>>> READ_ONLY | DROP_DOWN Combo. We can accomplish this by adding an empty
>>> item in Combo but it has a valid index instead of -1 which would be no
>>> selection. Has anyone found a better way around this? It would be
>>> great if the Combo supported a style that would create this item for us.
>>> Also by having an empty item it forces the indexes between the list
>>> and our model to be off by 1.
>>>
>>> Thanks,
>>> Brad
>>
>>
>>
>>


--
Friederich Kupzog
Elektronik & Software
Neusser Str. 5-7
50670 Köln
Tel 0241 160696-1
Fax 0221 726670
www.kupzog.de/fkmk
Re: Combo unselect item [message #462130 is a reply to message #462126] Thu, 06 October 2005 21:58 Go to previous messageGo to next message
Brad Reynolds is currently offline Brad Reynolds
Messages: 309
Registered: July 2009
Senior Member
I think I'll at least log an enhancement request so that it's documented
in case someone comes looking for it later. Steve, you can shut me down
there. :)

Friederich Kupzog wrote:
> Hi, my quite large database applications all make use of the "empty
> item" and users are absolutely ok with that.
> Regards,
> Friederich
>
> Brad Reynolds wrote:
>
>> I tried that but they (functional people) didn't want the end user to
>> be able to enter a value. The text box gives the user the feel that
>> they can type in anything which in our case isn't true. They just
>> need to be able to deselect the value and we end up adding this empty
>> item to do so everywhere. I thought that others might have this issue
>> as well outside our company but maybe not.
>>
>> Steve Northover wrote:
>>
>>> MAybe you should be using an editable combo box then. A read only
>>> combo box
>>> can't show text that is not one of the items.
>>>
>>> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>>> news:dhfkt7$3p1$1@news.eclipse.org...
>>>
>>>> We have the need for the end user to unselect the selection in a
>>>> READ_ONLY | DROP_DOWN Combo. We can accomplish this by adding an empty
>>>> item in Combo but it has a valid index instead of -1 which would be no
>>>> selection. Has anyone found a better way around this? It would be
>>>> great if the Combo supported a style that would create this item for
>>>> us.
>>>> Also by having an empty item it forces the indexes between the list
>>>> and our model to be off by 1.
>>>>
>>>> Thanks,
>>>> Brad
>>>
>>>
>>>
>>>
>>>
>
>
Re: Combo unselect item [message #462132 is a reply to message #462130] Thu, 06 October 2005 22:09 Go to previous messageGo to next message
Brad Reynolds is currently offline Brad Reynolds
Messages: 309
Registered: July 2009
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=111854

Brad Reynolds wrote:
> I think I'll at least log an enhancement request so that it's documented
> in case someone comes looking for it later. Steve, you can shut me down
> there. :)
>
> Friederich Kupzog wrote:
>
>> Hi, my quite large database applications all make use of the "empty
>> item" and users are absolutely ok with that.
>> Regards,
>> Friederich
>>
>> Brad Reynolds wrote:
>>
>>> I tried that but they (functional people) didn't want the end user to
>>> be able to enter a value. The text box gives the user the feel that
>>> they can type in anything which in our case isn't true. They just
>>> need to be able to deselect the value and we end up adding this empty
>>> item to do so everywhere. I thought that others might have this
>>> issue as well outside our company but maybe not.
>>>
>>> Steve Northover wrote:
>>>
>>>> MAybe you should be using an editable combo box then. A read only
>>>> combo box
>>>> can't show text that is not one of the items.
>>>>
>>>> "Brad Reynolds" <bradleyjames@gmail.com> wrote in message
>>>> news:dhfkt7$3p1$1@news.eclipse.org...
>>>>
>>>>> We have the need for the end user to unselect the selection in a
>>>>> READ_ONLY | DROP_DOWN Combo. We can accomplish this by adding an
>>>>> empty
>>>>> item in Combo but it has a valid index instead of -1 which would be no
>>>>> selection. Has anyone found a better way around this? It would be
>>>>> great if the Combo supported a style that would create this item
>>>>> for us.
>>>>> Also by having an empty item it forces the indexes between the list
>>>>> and our model to be off by 1.
>>>>>
>>>>> Thanks,
>>>>> Brad
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
Re: Combo unselect item [message #541048 is a reply to message #461736] Fri, 18 June 2010 07:44 Go to previous messageGo to next message
jh Han is currently offline jh Han
Messages: 2
Registered: June 2010
Junior Member
Combo.deselectAll() function does what you really want to. Very Happy
Re: Combo unselect item [message #905679 is a reply to message #541048] Thu, 30 August 2012 21:52 Go to previous message
Kris De Volder is currently offline Kris De Volder
Messages: 5
Registered: August 2012
Junior Member
Thanks, Combo.deselectAll was the answer to my question (although I think it isn't the same question as the original that was asked here by Brad.

I.e. what I needed was a way to programatically clear the selection.

What Brad is asking for is for a way for the user to clear the selection.

As far as I can tell, there's no way for the user to deselect an item in a read-only dropdown combo. Once he has selected a value he can not deselect it, unless I am missing something here.

Now... for my case that's not a problem though Smile

But I do agree with Brad that it would be logical for there to be some way that a user should be able to do what deselectAll does. The Combo UI may start out with nothing selected, so why should a user not be allowed to return it to that state?

Kris
Previous Topic:Large Content in a Dialog
Next Topic:java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jface.text.TextSelection
Goto Forum:
  


Current Time: Sat Oct 25 08:57:46 GMT 2014

Powered by FUDForum. Page generated in 0.02982 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software