[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: [Databinding] Bind a widget combo

you should ask this in the eclipse.platform newsgroup since databindings are
implemented at the UI level

"Yoko" <remertz@xxxxxxxxxxxxxx> wrote in message
news:bff07719e9113d8acf61aee4b80e7eec$1@xxxxxxxxxxxxxxxxxx
> Hi,
> I have an object Adress:
> public class Adresse {
>
> private int id;
>
> private String adress1;
>
> private String adress2;
>
> private String cp;
>
> private String city;
>
> private Country country;
> }
>
> This object contains an object Pays. In my database, I have a list of
> country.
> When I set my form with this object. I initialize a combo with a list of
> country which are in my database. But one object adress is linked to one
> country.
> So, when I initialize my form with the object Adress, I must select the
> good country in the combo.
> My question is how to do that?
>
>
> here: my code
> db.bind(tVille, new Property(adr, "city", String.class,
> Boolean.FALSE), null);
> db.bind(tRue, new Property(adr, "adress1", String.class,
> Boolean.FALSE), null);
> db.bind(tComplement, new Property(adr, "adress2", String.class,
> Boolean.FALSE), null);
> db.bind(tCP, new Property(adr, "cp", String.class,
> Boolean.FALSE), null);
> //
> Country _country = adr.getCountry();
> // db.bind(comboViewer, new Property(_country, "libelle", Country.class,
> // Boolean.FALSE), null);
>
>
> I use a comboViewer, but i have a problem.
> thx,
> yoko
>
>