Skip to main content


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 20:45 Go to next message
Christian is currently offline ChristianFriend
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 10:10 Go to previous messageGo to next message
Valer Roman is currently offline Valer RomanFriend
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 13:18 Go to previous messageGo to next message
Christian is currently offline ChristianFriend
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 14:32 Go to previous message
Valer Roman is currently offline Valer RomanFriend
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:Contextual menu on a custom widget
Next Topic:Generate RAP from RCP application
Goto Forum:
  


Current Time: Fri Apr 26 22:53:21 GMT 2024

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

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

Back to the top