Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » combo box showing down arrow sign after leaving the combo
combo box showing down arrow sign after leaving the combo [message #1410130] Tue, 19 August 2014 23:11 Go to next message
Sunny          is currently offline Sunny Friend
Messages: 37
Registered: September 2011
Member
Question on combo box editor. Why after leaving the combobox it is still showing the down arrow? please refer to images.

index.php/fa/18904/0/
index.php/fa/18905/0/

Is there a work around?
Thanks.
Re: combo box showing down arrow sign after leaving the combo [message #1410221 is a reply to message #1410130] Wed, 20 August 2014 06:33 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I just see an active combo box cell editor with open dropdown and an active combo box cell editor with a closed dropdown.

Regarding your question, you didn't leave the editor, but only closed the dropdown.

So the real question is, how do you think you left the editor?
Re: combo box showing down arrow sign after leaving the combo [message #1410367 is a reply to message #1410221] Wed, 20 August 2014 15:10 Go to previous messageGo to next message
Sunny          is currently offline Sunny Friend
Messages: 37
Registered: September 2011
Member
Ok. I clicked on the down arrow to open the combo box and then without clicking any item in the combo box I again clicked on the down arrow. This should have closed the combo box, not just hide the dropdown, so I can see the same cell view which was there before I clicked on the down arrow.
Hope I am clear.
Re: combo box showing down arrow sign after leaving the combo [message #1410402 is a reply to message #1410367] Wed, 20 August 2014 17:27 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I think on clicking the down arrow again, only the dropdown should be closed, not the editor closed.

So I don't see an issue here.
Re: combo box showing down arrow sign after leaving the combo [message #1410432 is a reply to message #1410402] Wed, 20 August 2014 19:22 Go to previous messageGo to next message
Sunny          is currently offline Sunny Friend
Messages: 37
Registered: September 2011
Member
After leaving the editor ( I mean by clicking on the down arrow again without selecting any item in the list of combo box ), I don't want to see the down arrow. It seems to hanging in there, unless I click on somewhere else in the table. If I click somewhere else in the UI the down arrow seems to be disappear. But a joe user will not have this idea.
How can I do that? to start with , I see a Canvas on the combobox that does the rendering of the down arrow. but its a private method.
Re: combo box showing down arrow sign after leaving the combo [message #1410434 is a reply to message #1410432] Wed, 20 August 2014 19:26 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Clicking on the down arrow icon does not close the editor! That is the implementation. It will only close the dropdown. This is intended! And AFAIK this is how combo boxes work, the combo box keeps the focus if you simply click on the arrow icon.

If you want it to close, you need to click on an item in the list or press ESC or Enter.

If you need a combobox with different behaviour you need to implement your own.
Re: combo box showing down arrow sign after leaving the combo [message #1410438 is a reply to message #1410434] Wed, 20 August 2014 19:34 Go to previous messageGo to next message
Sunny          is currently offline Sunny Friend
Messages: 37
Registered: September 2011
Member
Dirk,
thanks for the quick reply. Even if I click on the cell itself not necessarily down arrow and click on it again the dropdown is not closed. I have to do ESC to close the editor. But this is not how it was in net.sourceforge.nattable version. It seems to work fine there.
Re: combo box showing down arrow sign after leaving the combo [message #1410442 is a reply to message #1410438] Wed, 20 August 2014 19:38 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Yes because the NatCombo evolved since then and now behaves like combo boxes in SWT. Also it supports now free text editing if enabled and correctly works with keyboard navigation.

As said before, you can close it by selecting the already selected item, but you need to select an item or press ESC.
Re: combo box showing down arrow sign after leaving the combo [message #1410454 is a reply to message #1410442] Wed, 20 August 2014 20:24 Go to previous messageGo to next message
Sunny          is currently offline Sunny Friend
Messages: 37
Registered: September 2011
Member
Actually this messes up my image rendering in the cell, unless I escape or click else where on the nattable to close the combo box, I don't see the image that is associated with a particular selection on the combo box.
Anyways, I think I need to write my own to get the desired behavior.
I think it will be nice to close the editor if we click again on the down arrow or the cell without selecting any item in the combobox, so that users can see original cell view ( in my case I have to set image on the cell based on the selection ).

All I had to do was include
public void mouseUp( MouseEvent e )
{
hideDropDownControl();
}

on text and canvas.
Re: combo box showing down arrow sign after leaving the combo [message #1410460 is a reply to message #1410454] Wed, 20 August 2014 20:43 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Quote:
I think it will be nice to close the editor if we click again on the down arrow or the cell without selecting any item in the combobox, so that users can see original cell view


Your opinion collides with the opinion of other users that say they want to keep the combobox active to see what is underneath the open dropdown to open it again.

Adding your code to the iconCanvas in NatCombo breaks the behavior on clicking the down arrow. At least in my workspace. I don't know of which version we are talking about and which codebase you have. But hideDropDownControl() does not close the editor, it only hides the dropdown. This can't be the solution.

What you need is to override mouseDown() to close the editor instead of hiding it.

BTW, with this change you remove the ability to move the focus to the text control to allow editing.
Re: combo box showing down arrow sign after leaving the combo [message #1410465 is a reply to message #1410460] Wed, 20 August 2014 21:01 Go to previous messageGo to next message
Sunny          is currently offline Sunny Friend
Messages: 37
Registered: September 2011
Member
actually I wanted to hide and not close. I am using 1.1.0 version of nebula.nattable
Re: combo box showing down arrow sign after leaving the combo [message #1410470 is a reply to message #1410465] Wed, 20 August 2014 21:20 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
But hiding is what is happening already. So I don't understand your problem.
Previous Topic:Custom Labels
Next Topic:GroupBy Multiple-Item Column (Array/List)
Goto Forum:
  


Current Time: Fri Apr 26 04:21:34 GMT 2024

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

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

Back to the top