fother
19 Feb 2009, 4:47 AM
GXT: 1.2.3
GWT: 1.5.3
you can see that when using nested attribute to show the display field.. the list don't show nothing..
App
public void onModuleLoad() {
final ComboBox<BeanModel> combo = new ComboBox<BeanModel>();
RpcProxy proxy = new RpcProxy() {
@Override
protected void load(Object loadConfig, AsyncCallback callback) {
RPCExample.Util.getInstance().getBeans(callback);
}
};
ListLoader loader = new BaseListLoader(proxy, new BeanModelReader());
ListStore store = new ListStore(loader);
combo.setDisplayField("music.name");
combo.setStore(store);
combo.setMinChars(1);
RootPanel.get().add(combo);
}
RPCExampleImpl
public List<Customer> getBeans() {
List<Customer> customers = new ArrayList<Customer>();
customers.add(new Customer("diego", "xxxx@foo.com", 1, new Music("diego music")));
customers.add(new Customer("felipe", "xxxx@foo.com", 1, new Music("felipe music")));
customers.add(new Customer("alan", "xxxx@foo.com", 1, new Music("alan music")));
customers.add(new Customer("gordo", "xxxx@foo.com", 1, new Music("gordo music")));
return customers;
}
Music
public class Music implements Serializable {
private String name;
public Music() {
}
public Music(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Customer
public class Customer implements Serializable {
private String name;
private String email;
private int age;
private Music music;
public Customer() {
}
public Customer(String name, String email, int age, Music music) {
this.age = age;
this.email = email;
this.name = name;
this.music = music;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Music getMusic() {
return music;
}
public void setMusic(Music music) {
this.music = music;
}
}
GWT: 1.5.3
you can see that when using nested attribute to show the display field.. the list don't show nothing..
App
public void onModuleLoad() {
final ComboBox<BeanModel> combo = new ComboBox<BeanModel>();
RpcProxy proxy = new RpcProxy() {
@Override
protected void load(Object loadConfig, AsyncCallback callback) {
RPCExample.Util.getInstance().getBeans(callback);
}
};
ListLoader loader = new BaseListLoader(proxy, new BeanModelReader());
ListStore store = new ListStore(loader);
combo.setDisplayField("music.name");
combo.setStore(store);
combo.setMinChars(1);
RootPanel.get().add(combo);
}
RPCExampleImpl
public List<Customer> getBeans() {
List<Customer> customers = new ArrayList<Customer>();
customers.add(new Customer("diego", "xxxx@foo.com", 1, new Music("diego music")));
customers.add(new Customer("felipe", "xxxx@foo.com", 1, new Music("felipe music")));
customers.add(new Customer("alan", "xxxx@foo.com", 1, new Music("alan music")));
customers.add(new Customer("gordo", "xxxx@foo.com", 1, new Music("gordo music")));
return customers;
}
Music
public class Music implements Serializable {
private String name;
public Music() {
}
public Music(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Customer
public class Customer implements Serializable {
private String name;
private String email;
private int age;
private Music music;
public Customer() {
}
public Customer(String name, String email, int age, Music music) {
this.age = age;
this.email = email;
this.name = name;
this.music = music;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Music getMusic() {
return music;
}
public void setMusic(Music music) {
this.music = music;
}
}