在Listgrid(smartGWT)中设置值 [英] set the values in Listgrid (smartGWT)

查看:140
本文介绍了在Listgrid(smartGWT)中设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



我无法设置值table。



这段代码是复合的。

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

$ b $ private Horizo​​ntalPanel getTablePanel(){
if(tablePanel == null){
tablePanel = new Horizo​​ntalPanel();
tablePanel.setSize(144px,75px);

addtable();

$ b $ public void addtable(){
// TODO自动生成的方法存根
if(isDocumentPresent()== false){

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

}
}
私人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();
}
返回documentTable;

$ b $ public ListGridField getStatus(){
if(status == null){
status = new ListGridField(statusIcon,);
}
返回状态;
}
public ListGridField getIcon(){
if(icon == null){
icon = new ListGridField(documentIcon,);
}
返回图标;
}

。 (),getModifiedby(),getModifiedDate(),getMajorVersiosn()
$ .b private void addValuesToTable(){
documentTable.setData(documentsArray); // documentarray是记录
}


----------
错误

com.smartgwt.client .core.JsObject $ SGWT_WARN:12:15:47.778:警告:ListGrid:isc_ListGrid_0:无法找到clipHandle用于绘制的帆布,elementId:在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)
isc_0
在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
在java.lang.reflect.Constructor.newInstance(构造函数.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch .java:71)在com.go处
ogle.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
在com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
。在COM。 google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
在com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
。在COM。 google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
,位于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)
处com.smartgwt.client.widgets com.smartgwt.client.widgets.BaseWidget.getElement(BaseWidget.java:276)
。 BaseW您可以通过com.google.gwt.user.client.ui.ComplexPanel.add(ComplexPanel.java:94)
获取com.google.gwt.user上的idget.getElement(BaseWidget.java:264)
。 client.ui.Horizo​​ntalPanel.add(Horizo​​ntalPanel.java:49)
在com.client.SmartGuI.TableDocument.addtable(TableDocument.java:158)
在com.client.GUI.TreeCmis $ 2.onSuccess (TreeCmis.java:157)
在com.client.GUI.TreeCmis $ 2.onSuccess(TreeCmis.java:1)
在com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter。 onResponseReceived(RequestCallbackAdapter.java:232)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at


解决方案

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



你可以用HLayout(这是SmartGWT)代替Horizo​​ntalLayout(我猜想是GWT)。 >引用来自: http://forums.smartclient.com/showthread.php?t=8159


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


  • 增量迁移到智能GWT,比如将日历或CubeGrid等奇异的,复杂的智能GWT
    组件引入到现有的GWT应用程序中。

  • 使用复杂的第三方智能GWT中的GWT小部件,其中智能GWT没有
    相应的内置功能




然而,自由混合没有意义智能GWT和GWT
(或其他)组件,也就是说,例如,您不应将GWT
小部件放置在GWT
容器内的智能GWT容器内。一般来说,不要混用小部件,除非需要
功能强制您。



原因是最大程度的限制
两个Ajax小部件包(包括GWT)可以互操作 - 有
没有标准可以在
标签顺序,zIndex管理,像素完美布局,508部分管理区域实现互操作性
可访问性和多级模态。

注意,当GWT和智能GWT
混合不当时会报告错误(也就是说,与这些准则)通常会被标记为WONTFIX,但如果核心GWT开始支持允许更好的
互操作性的API,我们将在未来重新审视这个



I am trying to use smart Gwt, Listgrid.

I am using both com.google.gwt.user.client.ui and smart gwt. I have value in a ListGridRecords[] records.

I am unable to set the values in table.

this piece of code is in composite.

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 

解决方案

I would suggest not mixed GWT UI and SmartGWT. Try using only SmartGWT and see if the problem goes away.

You could starting by replacing HorizontalLayout (wich I suppose is GWT) by HLayout (which is SmartGWT).

Quote from : http://forums.smartclient.com/showthread.php?t=8159

Smart GWT has interoperability support that allows a Smart GWT widget to be added to a GWT container and allows a GWT widget to be added to a Smart GWT container, and it's appropriate to use this for:

  • incremental migration to Smart GWT, such as introducing singular, sophisticated Smart GWT components like the Calendar or CubeGrid to an existing GWT application

  • using sophisticated third-party GWT widgets within Smart GWT, where Smart GWT doesn't have corresponding built-in functionality

However it does not make sense to freely intermix Smart GWT and GWT (or other) components, that is, for example, you should not place GWT widgets within a Smart GWT container that is in turn within a GWT container. In general, don't intermix widgets unless the need for a feature forces you to.

The reason for this is that there are limits to the maximum degree that two Ajax widget kits (including GWT) can interoperate - there are no standards that allow interoperability in the areas of management of tab order, zIndex management, pixel-perfect layout, section 508 accessibility and multi-level modality.

Note that "bugs" reported when intermixing GWT and Smart GWT inappropriately (that is, in contradiction to these guidelines) are generally going to be marked WONTFIX, although we will revisit this in the future if core GWT begins to support APIs that would allow better interoperability.

这篇关于在Listgrid(smartGWT)中设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆