【问题标题】:set the values in Listgrid (smartGWT)在 Listgrid (smartGWT) 中设置值
【发布时间】:2012-05-11 19:51:54
【问题描述】:

我正在尝试使用智能 Gwt,Listgrid。

我同时使用 com.google.gwt.user.client.ui 和 smart gwt。 我在 ListGridRecords[] 记录中有价值。

我无法设置表格中的值。

这段代码是复合的。

public TableDocument(Action action) {
        initWidget(getTablePanel());
    }

private HorizontalPanel getTablePanel() {
        if (tablePanel == null) {
            tablePanel = new HorizontalPanel();
            tablePanel.setSize("144px", "75px");

            addtable();
        }

public void addtable() {
        // TODO Auto-generated method stub
        if(isDocumentPresent()==false){

            tablePanel.add(getNoDocumentLabel());
        }else{
            tablePanel.remove(noDocumentLabel);
            tablePanel.add(getDocumentTable()); <-- Error

        }
    }
private ListGrid getDocumentTable() {
        if (documentTable == null) {
            documentTable = new ListGrid();
            documentTable.setSize("644px", "379px");
            documentTable.setCanResizeFields(true);

            documentTable.setFields(getStatus(),getIcon(),getName(),getSize(),getModifiedby(),getModifiedDate(),getMajorVersiosn());
            addValuesToTable();
        }
        return documentTable;
    }

public ListGridField getStatus() {
        if (status == null) {
            status = new ListGridField("statusIcon","");
        }
        return status;
    }
public ListGridField getIcon() {
        if (icon == null) {
            icon = new ListGridField("documentIcon","");
        }
        return icon;
    }
.
.
.// similar code for getSize(),getModifiedby(),getModifiedDate(),getMajorVersiosn()

private void addValuesToTable() {
documentTable.setData(documentsArray);//documentarray is records
}


----------
error

    com.smartgwt.client.core.JsObject$SGWT_WARN: 12:15:47.778:WARN:ListGrid:isc_ListGrid_0:Unable to find clipHandle for drawn Canvas, elementId: isc_0
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.smartgwt.client.widgets.grid.ListGrid.create(ListGrid.java)
        at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
        at com.smartgwt.client.widgets.BaseWidget.getElement(BaseWidget.java:276)
        at com.smartgwt.client.widgets.BaseWidget.getElement(BaseWidget.java:264)
        at com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:94)
        at com.google.gwt.user.client.ui.HorizontalPanel.add(HorizontalPanel.java:49)
        at com.client.SmartGuI.TableDocument.addtable(TableDocument.java:158)
        at com.client.GUI.TreeCmis$2.onSuccess(TreeCmis.java:157)
        at com.client.GUI.TreeCmis$2.onSuccess(TreeCmis.java:1)
        at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
        at 

【问题讨论】:

  • 我猜你已经尝试将 SmartGWT 与普通 GWT 混合使用。
  • @HardikMishra :我需要帮助。请查看link

标签: gwt smartgwt gwt2 listgrid


【解决方案1】:

我建议不要混合使用 GWT UI 和 SmartGWT。尝试仅使用 SmartGWT 并查看问题是否消失。

您可以先将 Horizo​​ntalLayout(我认为是 GWT)替换为 HLayout(即 SmartGWT)。

引用自:http://forums.smartclient.com/showthread.php?t=8159

Smart GWT 具有互操作性支持,允许 Smart GWT 小部件 要添加到 GWT 容器并允许将 GWT 小部件添加到 一个 Smart GWT 容器,它适用于:

  • 向 Smart GWT 的增量迁移,例如引入单一、复杂的 Smart GWT 将日历或 CubeGrid 等组件添加到现有 GWT 应用程序

  • 在 Smart GWT 中使用复杂的第三方 GWT 小部件,而 Smart GWT 没有 对应的内置功能

但是,随意混合 Smart GWT 和 GWT 是没有意义的 (或其他)组件,也就是说,例如,您不应该将 GWT Smart GWT 容器中的小部件,该容器又位于 GWT 中 容器。一般来说,除非需要 功能迫使您这样做。

这样做的原因是最大程度有限制 两个 Ajax 小部件工具包(包括 GWT)可以互操作 - 有 没有标准允许在管理领域的互操作性 选项卡顺序、zIndex 管理、像素完美布局、第 508 节 可访问性和多级模式。

请注意,混合 GWT 和 Smart GWT 时会报告“错误” 不恰当地(即与这些准则相矛盾)是 通常会被标记为 WONTFIX,尽管我们将在 未来,如果核心 GWT 开始支持 API 将允许更好 互操作性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-07
    相关资源
    最近更新 更多