在 GWT 中构建树小部件

发布于 2024-11-07 08:02:31 字数 1021 浏览 0 评论 0原文

我正在尝试在 GWT 中构建一个树结构,当项目数量很大时,该结构可以滚动,该树结构将永久驻留在我的应用程序 DockLayout 面板的 WestRegion 上。

主要代码:

<!-- The west side has a panel with complex dynamic tree list to be implemented -->
    <g:west size='14'>
        <app:Mainlist ui:field='mainlist'/>
    </g:west>

主要列表:

  <g:VerticalPanel>
    <g:ScrollPanel>
        <g:HTMLPanel width='100%' >
            <div class='{style.contentColumn}'>
                <g:Tree ui:field='citytree'>
                    <g:TreeItem text='Delhi/NCR'/>
            </g:Tree>   
            </div>
        </g:HTMLPanel>
    </g:ScrollPanel>
  </g:VerticalPanel> 
</ui:UiBinder> 

但是我在西部地区没有看到任何东西。谁能指出我做错了什么?

此外: 在相应的“Mainlist.java”文件中,我不能说 @UiField Tree citytree(Gives Exception) 。这似乎是因为涉及嵌套。如何访问我的 Tree 实例?

GWT 展示已经在不使用 UiBinder 的情况下构建了 Tree。此外,我找不到任何使用 UiBinder 构建树结构的示例代码。有资源吗?

I am trying to build a Tree Structure in GWT which gets to be scrollable when the number of items are large, the Tree structure will permanently reside on the WestRegion of my Application DockLayout Panel.

The Main code:

<!-- The west side has a panel with complex dynamic tree list to be implemented -->
    <g:west size='14'>
        <app:Mainlist ui:field='mainlist'/>
    </g:west>

The Mainlist:

  <g:VerticalPanel>
    <g:ScrollPanel>
        <g:HTMLPanel width='100%' >
            <div class='{style.contentColumn}'>
                <g:Tree ui:field='citytree'>
                    <g:TreeItem text='Delhi/NCR'/>
            </g:Tree>   
            </div>
        </g:HTMLPanel>
    </g:ScrollPanel>
  </g:VerticalPanel> 
</ui:UiBinder> 

However I dont see anything in the west region. Can anyone point out what am I doing wrong?

Moreover:
In the corresponding "Mainlist.java" file I cannot say @UiField Tree citytree(Gives Exception) . This seems to be because of the nesting involved. How do I access my Tree instance?

The GWT showcase has Tree built without using UiBinder. Moreover I could not find any sample code to build a Tree structure with UiBinder. Any resources?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀念你的温柔 2024-11-14 08:02:31

经过更多的搜索和探索。我做到了。我认为网上没有示例代码,所以这篇文章可能对像我这样的学习者有帮助。

<ui:with field='res' type='myth.social.zomato.client.Mainlist.Images' />

    <ui:style src="resources/GlobalStyles.css">



    </ui:style> 

        <g:Tree ui:field='tree' resources='{res}'>
            <g:TreeItem text='Cities' >
                <g:TreeItem text='Ahemadabad'/>
                <g:TreeItem text='Banglore'/>
                <g:TreeItem text='Chennai' />
                <g:TreeItem text='Delhi/NCR' />
                <g:TreeItem text='Hyderabad' />
                <g:TreeItem text='Jaipur' />
                <g:TreeItem text='Kolkata'/>
                <g:TreeItem text='Mumbai'/>
                <g:TreeItem text='Pune' />
            </g:TreeItem>

            <g:TreeItem text='SalesPerson'>
                <g:TreeItem text='Sales1' />
                <g:TreeItem text='Sales2' />
            </g:TreeItem>       

        </g:Tree>   

After searching and exploring more. I did it. I think theere is no example code online so this post might be helpfull for learners like me.

<ui:with field='res' type='myth.social.zomato.client.Mainlist.Images' />

    <ui:style src="resources/GlobalStyles.css">



    </ui:style> 

        <g:Tree ui:field='tree' resources='{res}'>
            <g:TreeItem text='Cities' >
                <g:TreeItem text='Ahemadabad'/>
                <g:TreeItem text='Banglore'/>
                <g:TreeItem text='Chennai' />
                <g:TreeItem text='Delhi/NCR' />
                <g:TreeItem text='Hyderabad' />
                <g:TreeItem text='Jaipur' />
                <g:TreeItem text='Kolkata'/>
                <g:TreeItem text='Mumbai'/>
                <g:TreeItem text='Pune' />
            </g:TreeItem>

            <g:TreeItem text='SalesPerson'>
                <g:TreeItem text='Sales1' />
                <g:TreeItem text='Sales2' />
            </g:TreeItem>       

        </g:Tree>   
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文