ScrollPanel(高度)奇怪的行为GWT,
我发现 ScrollPanel 的行为很奇怪。它将高度缩小到大约 30px。 这是我的 ui.xml,
<g:ScrollPanel styleName="{style.fileViewerWorkspaceBg}">
<g:FlowPanel>
<g:FlowPanel>
<g:FlowPanel>
<my:OneClickFileUploader ui:field="uploader" enableMultipleFileUpload="true" />
</g:FlowPanel>
<g:FlowPanel ui:field="fileTablePanel">
<cell:SimplePager ui:field="pager"/>
<cell:CellTable ui:field="fileViewTable"/>
</g:FlowPanel>
<g:Label ui:field="processingField" />
</g:FlowPanel>
<g:FlowPanel ui:field="filePreview"/>
</g:FlowPanel>
</g:ScrollPanel>
我在 filePreview
和 filePreview 之间切换。 fileTablePanel
+ uploader
,当我显示 uploader+fileTablePanel
时,它显示滚动条,但当我切换到 filePreview
时>,它将 filePreview
面板的高度缩小到 ~30px。可能是什么问题。当我在 firebug
中将 ScrollPanel
的子 div
的高度更改为 100% 时,它会正常显示页面,但似乎我可以无法访问ScrollPanel的子div,有什么解决方法吗?
此外,当尝试将 ScrollPanel
设为 java 类中的 UiField 时,它会抛出异常,它只能有一个子项
,而实际上它只有一个子项。
谢谢。 阿尔
I am getting weird behavior of ScrollPanel. It shrinks the height to some how 30px.
Here is my ui.xml
<g:ScrollPanel styleName="{style.fileViewerWorkspaceBg}">
<g:FlowPanel>
<g:FlowPanel>
<g:FlowPanel>
<my:OneClickFileUploader ui:field="uploader" enableMultipleFileUpload="true" />
</g:FlowPanel>
<g:FlowPanel ui:field="fileTablePanel">
<cell:SimplePager ui:field="pager"/>
<cell:CellTable ui:field="fileViewTable"/>
</g:FlowPanel>
<g:Label ui:field="processingField" />
</g:FlowPanel>
<g:FlowPanel ui:field="filePreview"/>
</g:FlowPanel>
</g:ScrollPanel>
I am toggling between filePreview
& fileTablePanel
+ uploader
, When I display uploader+fileTablePanel
, it shows me the scroll bars but when i toggle to filePreview
, it shrinks the height of filePreview
panel to ~30px. What could be the problem. When I change the height of child div
of ScrollPanel
to 100% in firebug
, then it displays the page fine, but it seems that I can not access the child div of ScrollPanel, any workaround?
Moreover when try make the ScrollPanel
a UiField in java class it throws the exception that it can have only one child
and in actual it has a one child.
thank you.
al
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这个问题被问到已经有一段时间了,但这是我在遇到同样问题时使用的解决方案:
这是因为滚动面板是一个简单的面板。
当通过代码或 uibinder 设置/添加小部件时,它将使用 this.containerElem 来保存其子部件,
这是生成的 html。我给它们命名是为了让大家更清楚:
I know it's been a while since this question was asked but this is the solution I used when faced with the same problem:
This is because Scroll panel is a simple panel.
When a widget is set/added, via code or uibinder, it will used
this.containerElem
to hold its childrenThis is the resulting html. I named them in hopes to make it clearer:
尝试将 styleName 与
< /代码>。
height:100%;
设置为 FlowPanel(生成的 HTML 中的 div)。还有您的代码“缺少结束标记 g:FlowPanel”。
之前的标签可能有拼写错误,应该是
而不是
Try to set styleName with
height:100%;
to FlowPanel (div in resulting HTML).Also your code "missing end tag g:FlowPanel".
Probably typo in tag before
</g:ScrollPanel>
, should be</g:FlowPanel>
instead of<g:FlowPanel />
.