如何使 GWT 列表框可编辑选择的一部分
根据我的要求,我编写了一个自定义面板,它将显示三个列表框,使用户能够从此自定义列表框中选择日期。这三个列表框负责显示月、日、年值。现在我想让我的三个列表框可编辑并且同时可选择。我的意思是我想提供一个用户首选项,日期可以编辑,同时也可以选择。我怎样才能在 GWT 中做到这一点。这里我使用的是GWT2.0。任何人请给一个想法。
As per my requirement I have written a custom panel which will display three ListBoxes to enable user to select date from this custom list boxes.These three list boxes are responsible for showing month,day,year value. Now I would like to make my three list boxes are editable and at the same time selectable. I mean I would like to provide a user preferences that date can editable and at the same time selectable. How can I do this in GWT. Here I am using GWT2.0. Any one please give an idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
浏览器不提供这样的控件。 GWT 也没有。您需要编写自己的代码。 EXT-GWT(非免费)ComboBox 具有此功能。 http://www.extjs.com/examples/
Smart GWT 也是如此(也不是免费的) http://www.smartclient.com/smartgwt/ Showcase/#styled_combobox_category
如果您要自己推出,则可以从具有 TextBox 和单击 TextBox(或其一部分)时显示的 VerticalPanel 的 Composite 开始。您的面板将包含可点击的项目。
A browser does not provide such a control. Neither does GWT. You will need to code your own. EXT-GWT(not free) ComboBox has this functionality. http://www.extjs.com/examples/
So does Smart GWT (also not free) http://www.smartclient.com/smartgwt/showcase/#styled_combobox_category
If you were to roll your own, you would start with a Composite which has a TextBox and a VerticalPanel that is shown when a TextBox (or part of it) is clicked. Your panel would contain the clickable items.
您可以使用 suggestBox 而不是列表框来解决这个问题。但用户必须开始输入才能显示列表。
You could work that out using a suggestBox instead of the list box. But user would have to start typing to display the list.
您可以使用绝对面板来实现相同的...
下面是代码片段。
使用文本框隐藏选择框调整文本框的宽度和位置,使其覆盖下拉列表...
You can use absolute panel to achive the same ...
Below is the code snippet.
Hide the selectbox using textbox adjust the width and location of textbox so that it should cover dropdown list...