Gwt GXT model.get()返回错误类型的实例

Gwt GXT model.get()返回错误类型的实例,gwt,casting,gxt,Gwt,Casting,Gxt,在我的应用程序中,我使用的是GWT2.5.0和GXT2.2.5。因此,我的ColumnConfig列带有以下渲染器: column.setRenderer(新的GridCellRenderer(){ @凌驾 公共文本呈现(ModelData模型、字符串属性、ColumnData配置、int-rowIndex、int-colIndex、ListStore-ListStore、网格){ List accountGroups=model.get(属性); //这里有些东西 返回组文本; } });

在我的应用程序中,我使用的是GWT2.5.0和GXT2.2.5。因此,我的ColumnConfig列带有以下渲染器:

column.setRenderer(新的GridCellRenderer(){
@凌驾
公共文本呈现(ModelData模型、字符串属性、ColumnData配置、int-rowIndex、int-colIndex、ListStore-ListStore、网格){
List accountGroups=model.get(属性);
//这里有些东西
返回组文本;
}
});
但是当我试图用我的列表元素做一些事情时,我得到了某种类型的类型转换错误。我使用了一个调试器,我的列表元素的类型似乎是
com.example.core.application.api.BeanModel\u com\u example\u core\u application\u api\u AccountGroupDto
,它不能强制转换为
com.example.core.application.api.AccountGroupDto
,它应该是这样的


当我从1.7升级了gwt,从2.0.1升级了gxt时,出现了此错误。请将此类型添加到GridCellRenderer(根据您在使用BeanModel时出现的错误),因此请使用此类型:

column.setRenderer(new GridCellRenderer<BeanModel>() {

            @Override
            public Object render(BeanModel model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<BeanModel> store, Grid<BeanModel> grid) {
                // ...
现在,您可以从myObj获取对象:

List<AccountGroupDto> accountGroups  = myObj.get(property);
List accountGroups=myObj.get(属性);
希望这有帮助

List<AccountGroupDto> accountGroups  = myObj.get(property);