Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gwt MVP-必须进行哪些调整才能启用“MVP”;UiField FlowPanel";工作(而不是“UiField SimplePanel”);?_Gwt_Mvp_Uibinder - Fatal编程技术网

Gwt MVP-必须进行哪些调整才能启用“MVP”;UiField FlowPanel";工作(而不是“UiField SimplePanel”);?

Gwt MVP-必须进行哪些调整才能启用“MVP”;UiField FlowPanel";工作(而不是“UiField SimplePanel”);?,gwt,mvp,uibinder,Gwt,Mvp,Uibinder,我将“topPanel”UiField更改为指流程面板而不是SimplePanel。 --但是,当我这样做时,我的“View”类中的原始“setWidget”方法不再有效 我可以做什么调整(--如果可以),以允许正确编译和处理FlowPanel“@UiField” 这是“视图”类 这是uiBinder模板 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xml

我将“topPanel”UiField更改为指流程面板而不是SimplePanel。
--但是,当我这样做时,我的“View”类中的原始“setWidget”方法不再有效

我可以做什么调整(--如果可以),以允许正确编译和处理FlowPanel“@UiField”

这是“视图”类

这是uiBinder模板

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <ui:style src="app.css" />
    <g:HTMLPanel width="50%" height="50%">
        <!--  <g:SimplePanel ui:field="topPanel"> -->   
        <g:FlowPanel ui:field="topPanel">
            <g:Button text="from aaa: go to bbb" ui:field="topButtonA"></g:Button>
            <g:Button text="from bbb: go to ccc" ui:field="topButtonB"></g:Button>
            <g:Button text="from ccc: go to aaa" ui:field="topButtonC"></g:Button>
        </g:FlowPanel>
    </g:HTMLPanel>
</ui:UiBinder>

试试:

而不是

topPanel.setWidget(w)

如果要在topPanel中包含的按钮下方/之后添加小部件,应使用:

topPanel.add(w)

实际上,“view”类被称为“TopPanel”。“TopPanel.ui.xml”包含一个名为“TopPanel”的标记(我猜是混淆的),它对应于“TopPanel”视图类中的“@UiField TopPanel”。[续]…将“TopPanel”视图类定义为“public class TopPanel extensed Composite implements AcceptsOneWidget”…此定义所需的实现方法之一是“setWidget”。当我将“@UiField”从“SimplePanel”更改为“FlowPanel”时,IDE(或编译器)不允许使用“topPanel.setWidget(w)”…我将尝试“topPanel.insert”并让您知道发生了什么…--感谢您的帮助TopPanel是流程面板的名称,如代码中的@UiField和ui:field所示。您看到的确切异常或错误是什么?“类型FlowPanel的方法setWidget(IsWidget)未定义”
topPanel.setWidget(w)
topPanel.add(w)