안녕하세요 저는 GWT를 처음 접했고 GWTP도 처음이에요.GWTP : CellTable을 표시하는 데 문제가 있습니다.
나는 CellTables와 재생하려고하고 내가 GWTP MVP에 맞게 몇 가지 적응 developers.google.com/web-toolkit/doc/2.4/DevGuideUiCellWidgets#celltable 에서 GWT 문서 다음과 같은 간단한 하나를 구축하여 시작하기로 결정 디자인.
첫째, 내 View.ui.xml 파일 내 Celltable을 만들어 내 View.java 파일에
public class Contact {
private final String address;
private final String name;
public Contact(String name, String address) {
this.name = name;
this.address = address;
}
public String getAddress() {
return address;
}
public String getName() {
return name;
}
}
:
다음xmlns:c="urn:import:com.google.gwt.user.cellview.client">
<g:HTMLPanel>
<c:CellTable pageSize='15' ui:field='cellTable' />
</g:HTMLPanel>
을, 나는 클래스 연락을 생성
@UiField(provided=true) CellTable<Contact> cellTable = new CellTable<Contact>();
public CellTable<Contact> getCellTable() {
return cellTable;
}
마지막으로 내 Presenter.java 파일에서 :
당신의 도움에 미리 ...덕분에3210
public interface MyView extends View {
CellTable<Contact> getCellTable();
}
@Override
protected void onReset() {
super.onReset();
// Create name column.
TextColumn<Contact> nameColumn = new TextColumn<Contact>() {
@Override
public String getValue(Contact contact) {
return contact.getName();
}
};
// Create address column.
TextColumn<Contact> addressColumn = new TextColumn<Contact>() {
@Override
public String getValue(Contact contact) {
return contact.getAddress();
}
};
// Add the columns.
getView().getCellTable().addColumn(nameColumn, "Name");
getView().getCellTable().addColumn(addressColumn, "Address");
// Set the total row count.
getView().getCellTable().setRowCount(CONTACTS.size(), true);
// Push the data into the widget.
getView().getCellTable().setRowData(0, CONTACTS);
}
모든 것은 나에게 좋은 것 같습니다하지만이 코드를 시도 할 때 표시되지 CellTable가 없습니다 ... 그리고 나는 오류를 얻을!