Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » List Databinding
List Databinding [message #63261] Mon, 26 November 2007 23:11 Go to next message
Christian is currently offline ChristianFriend
Messages: 31
Registered: July 2009
Member
Hi,
i've linked a List Object to an Arraylist contained in the model in this
way:

bindingContext.bindList(SWTObservables.observeItems(_listGen re),
BeansObservable.observeList(Realm.getDefault(), model,
"listGenre"), null, null);

_listGenre is the List object



in the model i have put


public ArrayList<String> getListGenre() {
return listGenre;
}

public void setListGenre(ArrayList<String> listGenre) {
ArrayList<String> old = listGenre;
this.listGenre = listGenre;
changeSupport.firePropertyChange("listGenre", old, listGenre);
}


In this way no items are added to the arrayList when the _listGenre is
filled with elements. What's wrong?

thanks

Christian
Re: List Databinding [message #63718 is a reply to message #63261] Fri, 30 November 2007 16:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

This is a multi-part message in MIME format.
--------------010508080404000804070109
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

I would guess that you need to provide an UpdateListStrategy
BeansObserable#observeList() call.
Attached is a snippet that shows a List widget that is bound to a model
that provides the available Locales. UpdateListStrategy, including
converters, are used there as well.
However I would rathe recommend to use a ListViewer along with an
ObservableListContentProvider.

Cheers,
R
Re: List Databinding [message #63766 is a reply to message #63718] Fri, 30 November 2007 16:52 Go to previous message
Christian is currently offline ChristianFriend
Messages: 31
Registered: July 2009
Member
Thanks a lot Rudiger,
i've understood where I failed....i'll test your snippet asap.
Bye
Christian


Rüdiger Herrmann ha scritto:
> Hi,
>
> I would guess that you need to provide an UpdateListStrategy
> BeansObserable#observeList() call.
> Attached is a snippet that shows a List widget that is bound to a model
> that provides the available Locales. UpdateListStrategy, including
> converters, are used there as well.
> However I would rathe recommend to use a ListViewer along with an
> ObservableListContentProvider.
>
> Cheers,
> Rüdiger
>
>
> christian wrote:
>> Hi,
>> i've linked a List Object to an Arraylist contained in the model in this
>> way:
>>
>> bindingContext.bindList(SWTObservables.observeItems(_listGen re),
>> BeansObservable.observeList(Realm.getDefault(), model,
>> "listGenre"), null, null);
>>
>> _listGenre is the List object
>>
>>
>>
>> in the model i have put
>>
>>
>> public ArrayList<String> getListGenre() {
>> return listGenre;
>> }
>>
>> public void setListGenre(ArrayList<String> listGenre) {
>> ArrayList<String> old = listGenre;
>> this.listGenre = listGenre;
>> changeSupport.firePropertyChange("listGenre", old, listGenre);
>> }
>>
>>
>> In this way no items are added to the arrayList when the _listGenre is
>> filled with elements. What's wrong?
>>
>> thanks
>>
>> Christian
>
Previous Topic:Splash Screen
Next Topic:Can't set font with ColumnLabelProvider
Goto Forum:
  


Current Time: Fri Mar 29 11:21:52 GMT 2024

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

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

Back to the top