List Databinding [message #63261] |
Mon, 26 November 2007 18:11  |
Eclipse User |
|
|
|
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 #63766 is a reply to message #63718] |
Fri, 30 November 2007 11:52  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.04438 seconds