Expected behaviour when removing from a Combo widget [message #1037546] |
Tue, 09 April 2013 13:39  |
Eclipse User |
|
|
|
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 04:18  |
Eclipse User |
|
|
|
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/
|
|
|
Powered by
FUDForum. Page generated in 0.04003 seconds