我遇到了GWT CellTable的问题.我需要动态创建celltable,我没有实体(Bean)类这样做.我已经看过了celltable的所有例子,并且在没有实体类的情况下进行了很多搜索.
我需要根据存储在数据库中的一些元数据动态填充表.我能够创建表结构
考虑有两个类,一个是GRID,另一个是COLUMN,用于元数据和列定义.GRID将COLUMNS列表作为列定义
Class GRID {
List<COLUMN> columns;
}
Class COLUMN {
String columnName;
}
Run Code Online (Sandbox Code Playgroud)
现在我需要从数据库获取网格并循环列以填充单元格(列),如:
com.google.gwt.user.cellview.client.Column<String, String> textColumn = new Column<String, String>(
new EditTextCell()) {
@Override
public String getValue(String object) {
return object;
}
};
Run Code Online (Sandbox Code Playgroud)
现在,我需要向celltable添加一些数据.但没有实体,没有例子如何填充不同的列.我试过自己的样子:( 考虑网格有3列)
List<String> data;
String a1 = "A1";
String a2 = "A2";
String a3 = "A3";
data = new ArrayList<String>();
data.add(a1);
data.add(a2);
data.add(a3);
final AsyncDataProvider<String> provider = new AsyncDataProvider<String>() {
@Override
protected void onRangeChanged(HasData<String> display) {
updateRowData(0, data);
}
};
provider.addDataDisplay(grid);
provider.updateRowCount(data.size(), true); …Run Code Online (Sandbox Code Playgroud) 我在使用smartGWT的ListGrid中进行数据源绑定时遇到问题.我有GWT-RPC-DataSource,我已将其设置为我的数据源
grid.setDataSource(ds);
Run Code Online (Sandbox Code Playgroud)
单击一下按钮我的数据源有一些变化,我正在生成新的数据源并使用smartgwt的网格重新绑定.但它失败了.我已经尝试了grid.redraw()函数来重绘网格.
以下是我的GWTRPCDATASOURCE课程
public abstract class GwtRpcDataSource extends DataSource {
/**
* Creates new data source which communicates with server by GWT RPC. It is
* normal server side SmartClient data source with data protocol set to
* <code>DSProtocol.CLIENTCUSTOM</code> ("clientCustom" - natively supported
* by SmartClient but should be added to smartGWT) and with data format
* <code>DSDataFormat.CUSTOM</code>.
*/
public GwtRpcDataSource() {
setDataProtocol(DSProtocol.CLIENTCUSTOM);
setDataFormat(DSDataFormat.CUSTOM);
setClientOnly(false);
}
/**
* Executes request to server.
*
* @param request
* …Run Code Online (Sandbox Code Playgroud) 目前,我们在将应用程序从Hibernate 3.2.5迁移到3.6.1时遇到了很多问题.
我们面临的第一个错误是:
严重:列名'btn_name'无效.虽然btn_name没有映射到哪里.实际的映射是btnName.
这是我的映射文件
<hibernate-mapping>
<class abstract="true" name="com.sampleproject.client.beansdm.metadata.Component"
table="component_master">
<id column="metadata_id" name="id" type="long">
<generator class="native" />
</id>
<property column="metadata_type" name="type" type="string" />
<property name="createdDateTime" column="created_date" type="date"
update="false"></property>
<property name="version" type="string" column="version_id"></property>
<property name="currentDate" type="date" column="curr_date"></property>
<property name="currentIP" type="string" column="current_ip"></property>
<many-to-one name="currentUser"
class="com.sampleproject.client.beansdm.domain.common.User" cascade="refresh"
column="current_user_id"></many-to-one>
<property name="latestDate" type="date" column="latest_date"></property>
<property name="latestIP" type="string" column="latest_ip"></property>
<many-to-one name="latestUser"
class="com.sampleproject.client.beansdm.domain.common.User" cascade="refresh"
column="latest_user"></many-to-one>
<property name="recordStatus" type="boolean" column="record_status"></property>
<property name="portal" type="string" column="portal"></property>
<many-to-one cascade="refresh,save-update,delete"
class="com.sampleproject.client.beansdm.metadata.Component" column="md_id"
name="metadata" not-null="false" />
<joined-subclass
name="com.sampleproject.client.beansdm.metadata.uicontrols.UIControl"
table="ui_control_master">
<key column="ui_control_id" />
<property …Run Code Online (Sandbox Code Playgroud) 我试图用tomcat部署应用程序,我成功了.现在代替内部GWT服务器,我需要将tomcat设置为内置服务器的默认值并使用它调试我的应用程序.我面临的问题是我能够成功将文件上传到托管模式,但是当我尝试将我的应用程序部署到tomcat时,它给了我Struts拦截器的错误.
ERROR ParametersInterceptor.setParameters():242 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'fileUploadContentType' on 'class com.example.server.actions.FileUploadAction: Error setting expression 'fileUploadContentType' with value '[Ljava.lang.String;@12569b8'
ERROR ParametersInterceptor.setParameters():242 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'fileUploadFileName' on 'class com.example.server.actions.FileUploadAction: Error setting expression 'fileUploadFileName' with value '[Ljava.lang.String;@13fb1ab'
Run Code Online (Sandbox Code Playgroud)
我请求你建议我解决这个问题,或者重定向我如何在eclipse(GWT)中使用tomcat进行调试.
任何人都可以在这个问题上重定向我......
任何帮助深表感谢.
感谢您,
问候