Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Expected behaviour when removing from a Combo widget
Expected behaviour when removing from a Combo widget [message #1037546] Tue, 09 April 2013 17:39 Go to next message
Chris Boerger is currently offline Chris BoergerFriend
Messages: 21
Registered: March 2012
Junior Member
I'm not sure if this is expected behaviour for the Combo Drop Down list so don't yell if it is.

When I programmatically remove an item by index from the possible values, the selected item gets changed.

i.e.

String[] options = new String[] {"One", "Two", "Three"};
Combo c = new Combo(...);

c.setItems(options);
c.select(1); // Set to "Two"
c.remove(0); // Remove "One"
System.out.println(c.getText()); // Will print out "Three"???
c.remove(0); // Remove "Two"
System.out.println(c.getText()); // Bad!

Why does removing an item from the list change the selection? That doesn't seem to make sense to me. I haven't tested this in an RCP so I don't know if it is the same there.

I'm using RAP 2.0
Re: Expected behaviour when removing from a Combo widget [message #1037957 is a reply to message #1037546] Wed, 10 April 2013 08:18 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Chris,
in SWT the first sysout prints "Two"... the second - empty string. Is
this what you expect? It seems that the behavior is different between
RAP and SWT. Please open a bugzilla and we will investigate it.
Thanks,
Ivan

On 4/9/2013 8:39 PM, Chris Boerger wrote:
> I'm not sure if this is expected behaviour for the Combo Drop Down
> list so don't yell if it is.
>
> When I programmatically remove an item by index from the possible
> values, the selected item gets changed.
>
> i.e.
>
> String[] options = new String[] {"One", "Two", "Three"};
> Combo c = new Combo(...);
>
> c.setItems(options);
> c.select(1); // Set to "Two"
> c.remove(0); // Remove "One"
> System.out.println(c.getText()); // Will print out "Three"???
> c.remove(0); // Remove "Two"
> System.out.println(c.getText()); // Bad!
>
> Why does removing an item from the list change the selection? That
> doesn't seem to make sense to me. I haven't tested this in an RCP so I
> don't know if it is the same there.
>
> I'm using RAP 2.0
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Virgo + RAP + OSGi: Extension Points and Fancy Theme
Next Topic:CSS and font size
Goto Forum:
  


Current Time: Fri Apr 19 09:24:03 GMT 2024

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

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

Back to the top