Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » List listener problem
List listener problem [message #62723] Sat, 24 November 2007 15:45 Go to next message
Christian is currently offline Christian
Messages: 31
Registered: July 2009
Member
Hi,

i've added a Selection listener to a List; if i select some components
on the List, and invoking the method List.getSelection in the
implemented listener, it returns no items selected. Can be a bug?

here the code


list = new List(sectionClient2, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL
| SWT.BORDER);
list.add("item");
list.add("item2");
list.addListener(SWT.Selection,listener);



public final class MyListener implements Listener {

public void handleEvent(Event arg0) {
System.out.println(arg0);
String[] ele = list.getSelection();
for (int i = 0; i < ele.length; i++) {
System.out.println(ele[i]);
}

}
}


thx

Christian
Re: List listener problem [message #62746 is a reply to message #62723] Sun, 25 November 2007 05:10 Go to previous messageGo to next message
Valer Roman is currently offline Valer Roman
Messages: 36
Registered: July 2009
Member
Hi

I have ran your example and indeed it did not work, but that on the
1.0.1 integration build.
If u use release version 1.0 it works just fine.

Also the demo application does not work fine regarding list selection,
when using version 1.0.1

Cheers,
Val

Christian wrote:
> Hi,
>
> i've added a Selection listener to a List; if i select some components
> on the List, and invoking the method List.getSelection in the
> implemented listener, it returns no items selected. Can be a bug?
>
> here the code
>
>
> list = new List(sectionClient2, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL
> | SWT.BORDER);
> list.add("item");
> list.add("item2");
> list.addListener(SWT.Selection,listener);
>
>
>
> public final class MyListener implements Listener {
>
> public void handleEvent(Event arg0) {
> System.out.println(arg0);
> String[] ele = list.getSelection();
> for (int i = 0; i < ele.length; i++) {
> System.out.println(ele[i]);
> }
>
> }
> }
>
>
> thx
>
> Christian
Re: List listener problem [message #62821 is a reply to message #62746] Sun, 25 November 2007 08:18 Go to previous messageGo to next message
Christian is currently offline Christian
Messages: 31
Registered: July 2009
Member
Val,
Thanks for your answer. Do you think I should open a bug for this
version?Or realese version 1.1 will contain this bug fixed anyway?
Christian


Val ha scritto:
> Hi
>
> I have ran your example and indeed it did not work, but that on the
> 1.0.1 integration build.
> If u use release version 1.0 it works just fine.
>
> Also the demo application does not work fine regarding list selection,
> when using version 1.0.1
>
> Cheers,
> Val
>
> Christian wrote:
>> Hi,
>>
>> i've added a Selection listener to a List; if i select some components
>> on the List, and invoking the method List.getSelection in the
>> implemented listener, it returns no items selected. Can be a bug?
>>
>> here the code
>>
>>
>> list = new List(sectionClient2, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL
>> | SWT.BORDER);
>> list.add("item");
>> list.add("item2");
>> list.addListener(SWT.Selection,listener);
>>
>>
>>
>> public final class MyListener implements Listener {
>>
>> public void handleEvent(Event arg0) {
>> System.out.println(arg0);
>> String[] ele = list.getSelection();
>> for (int i = 0; i < ele.length; i++) {
>> System.out.println(ele[i]);
>> }
>>
>> }
>> }
>>
>>
>> thx
>>
>> Christian
Re: List listener problem [message #62853 is a reply to message #62821] Sun, 25 November 2007 09:32 Go to previous message
Valer Roman is currently offline Valer Roman
Messages: 36
Registered: July 2009
Member
Hi

yes I think u should open a bug report for that version. Also mention
that in the demo application the list selection does not work properly.

ciao,
Val

Christian wrote:
> Val,
> Thanks for your answer. Do you think I should open a bug for this
> version?Or realese version 1.1 will contain this bug fixed anyway?
> Christian
>
>
> Val ha scritto:
>> Hi
>>
>> I have ran your example and indeed it did not work, but that on the
>> 1.0.1 integration build.
>> If u use release version 1.0 it works just fine.
>>
>> Also the demo application does not work fine regarding list selection,
>> when using version 1.0.1
>>
>> Cheers,
>> Val
>>
>> Christian wrote:
>>> Hi,
>>>
>>> i've added a Selection listener to a List; if i select some components
>>> on the List, and invoking the method List.getSelection in the
>>> implemented listener, it returns no items selected. Can be a bug?
>>>
>>> here the code
>>>
>>>
>>> list = new List(sectionClient2, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL
>>> | SWT.BORDER);
>>> list.add("item");
>>> list.add("item2");
>>> list.addListener(SWT.Selection,listener);
>>>
>>>
>>>
>>> public final class MyListener implements Listener {
>>>
>>> public void handleEvent(Event arg0) {
>>> System.out.println(arg0);
>>> String[] ele = list.getSelection();
>>> for (int i = 0; i < ele.length; i++) {
>>> System.out.println(ele[i]);
>>> }
>>> }
>>> }
>>>
>>>
>>> thx
>>>
>>> Christian
Previous Topic:add a popup to table viewer
Next Topic:Drag and Drop
Goto Forum:
  


Current Time: Tue Jul 29 17:03:56 EDT 2014

Powered by FUDForum. Page generated in 0.01607 seconds