Tks for your help
I try to put the breakpoint, but i don't understand. I start in Java.
See below my code :
package de.vogella.gwt.helloserver.client.table;
import java.util.List;
import com.google.gwt.user.client.ui.FlexTable;
import de.vogella.gwt.helloserver.client.model.MyUser;
public class MyTable extends FlexTable {
DataSource input;
public MyTable(DataSource input){
super();
this.setCellPadding(1);
this.setCellSpacing(0);
this.setWidth("100%");
this.setInput(input);
}
public void setInput(DataSource input){
for (int i = this.getRowCount(); i>0; i--){
this.removeRow(0);
}
if (input == null){
return;
}
int row = 0;
List<String> headers = input.getTableheader();
if (headers != null){
int i = 0;
for (String string : headers){
this.setText(row, i, string);
i++;
}
row++;
}
this.getRowFormatter().addStyleName(0,"tableHeader");
List<MyUser> rows = input.getUsers();
int i = 0;
for (MyUser myUser : rows){
this.setText(i, 0, myUser.getId());
this.setText(i, 1, myUser.getUsername());
this.setText(i, 2, myUser.getNumberOfHits());
i++;
}
this.input = input;
}
}
package de.vogella.gwt.helloserver.client.table;
import java.util.ArrayList;
import java.util.List;
import de.vogella.gwt.helloserver.client.model.MyUser;
public class DataSource {
private final List<MyUser> users;
private List<String> header;
public DataSource(List<MyUser> users){
header = new ArrayList<String>();
header.add("id");
header.add("name");
header.add("Number of Hits");
this.users = users;
}
public List<MyUser> getUsers(){
return users;
}
public List<String> getTableheader(){
return header;
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.