Vaadin 单选按钮,水平放置而不是垂直堆叠
我想在 1 行中显示我的单选按钮,例如:
◎ 选项1 ◉选项2
但是,使用 Vaadin 我无法完成此操作,如下所示,
◎选项1
◉选项2
这是我的代码:
final List<String> options = Arrays.asList(new String[] {
"hebele", "hubele"});
final OptionGroup group = new OptionGroup("", options);
group.setNullSelectionAllowed(false); // user can not 'unselect'
group.select("hubele"); // select this by default
我该如何更改它?
I want to display my radio buttons in 1 line such as:
◎ Option1 ◉ Option2
However with Vaadin I cannot accomplish this it seems like the following,
◎ Option1
◉ Option2
here is my code:
final List<String> options = Arrays.asList(new String[] {
"hebele", "hubele"});
final OptionGroup group = new OptionGroup("", options);
group.setNullSelectionAllowed(false); // user can not 'unselect'
group.select("hubele"); // select this by default
How can i change this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Vaadin 7.3 中,Valo 主题支持水平
OptionGroup
,无需编写自定义样式:With Vaadin 7.3, Valo theme supports horizontal
OptionGroup
without writing custom style:正如 The Book of Vaadin 中所述,您必须定义主题来设置您自己的
style.css
文件。然后您可以覆盖要内联显示的选项的默认样式,如下所示:
As explained in the The Book of Vaadin, you've got to define a theme to setup your own
style.css
file.Then you can override the default style for the option to be displayed inline as follow:
我解决了这个问题,如下所示。
I solved this problem like following.