在 GWT 中构建树小部件
我正在尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过更多的搜索和探索。我做到了。我认为网上没有示例代码,所以这篇文章可能对像我这样的学习者有帮助。
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.