JSF 2 multiple select dropdown box example
In JSF, <h:selectManyMenu /> tag is used to render a multiple select dropdown box – HTML select element with “multiple” and “size=1” attribute.
//JSF...
<h:selectManyMenu value="#{user.favCoffee1}">
<f:selectItem itemValue="Cream Latte" itemLabel="Coffee3 - Cream Latte" />
<f:selectItem itemValue="Extreme Mocha" itemLabel="Coffee3 - Extreme Mocha" />
<f:selectItem itemValue="Buena Vista" itemLabel="Coffee3 - Buena Vista" />
</h:selectManyMenu>
//HTML output...
<select name="j_idt6:j_idt8" multiple="multiple" size="1">
<option value="Cream Latte">Coffee3 - Cream Latte</option>
<option value="Extreme Mocha">Coffee3 - Extreme Mocha</option>
<option value="Buena Vista">Coffee3 - Buena Vista</option>
</select>
However, the use of h:selectManyMenu tag is highly NOT recommended, because they do not display consistently in different internet browsers, see figures :
1. Internet Explorer 8
A tiny scroll bar to manipulate the dropdown box values.

2. FireFox 3.6.10
No scroll bar, look like a normal “textbox”, but you can click on the “textbox” and “drag up or down” or “key up and down” to manipulate the value.

3. Google Chrome 6.0.472.63
In Google Chrome, both << select element with "multiple" and size="1" attribute - "h:selectManyMenu” tag >> and << select element with "multiple" and size="total of records" attribute - "h:selectManyListbox” tag >> are display the exact layout.

Conclusion
Just forget about “h:selectManyMenu” tag, there is really no reason to use it. The “h:selectManyListbox” tag is a good alternative.
JSF 2 multiple select dropdown box example的更多相关文章
- JSF 2 multiple select listbox example
In JSF, <h:selectManyListbox /> tag is used to render a multiple select listbox – HTML select ...
- JSF 2 dropdown box example
In JSF, <h:selectOneMenu /> tag is used to render a dropdown box – HTML select element with &q ...
- 目录窗口多选Multiple Select in Catalog Window or arccatalog
目录窗口多选Multiple Select in Catalog Window or arccatalog 商务合作,科技咨询,版权转让:向日葵,135-4855__4328,xiexiaokui#q ...
- 实现两个select list box间item的移动和过滤
<head> <title> </title> <!--Standard jQuery --> <script type="text/j ...
- html multiple select option 分组
普通html方式展示<select name="viewType" style="width: 100%;height: 300px;" multiple ...
- [Angular 2] Build a select dropdown with *ngFor in Angular 2
We want the start-pipe more flexable to get param, so when using it, we pass a second param as statu ...
- [XAF] How to represent an enumeration property via a drop-down box with check boxes
https://www.devexpress.com/Support/Center/Example/Details/E689
- jQuery get selected text from SELECT (or DROPDOWN) list box
Most of the time in JavaScript we want to do following things with Select (or dropdown) list box. – ...
- Check Box Select/Deselect All on Grid
The below function is to be used on a grid with multiple check boxes. Place the code behind a FieldC ...
随机推荐
- WCF学习笔记之地址
1.统一资源标识(URI) URI全称是Uniform Resource Identifier(统一资源标识),唯一地标识一个网络资源的同时也标识资源所处的位置以及访问方式(资源访问所用的网络协议). ...
- 抽象工厂在ADO.Net中的应用
https://msdn.microsoft.com/zh-cn/library/ms971499.aspx http://www.c-sharpcorner.com/UploadFile/moses ...
- vpn局域网共享
vpn局域网共享 更改网关为vpn共享主机地址 在“命令运行符”处,挨个键入下列命令,并回车生效: regsvr32 Softpub.dll regsvr32 Wintrust.dll regsvr3 ...
- java中List的排序功能的实现
今天在工作的时候,遇到了List排序的问题,所以总结了一下,与大家分享.Collections.sort排序的时候,用到了Comparator接口下面的compare()方法.下面的小例子中,还用到了 ...
- UVa 11752 (素数筛选 快速幂) The Super Powers
首先有个关键性的结论就是一个数的合数幂就是超级幂. 最小的合数是4,所以枚举底数的上限是pow(2^64, 1/4) = 2^16 = 65536 对于底数base,指数的上限就是ceil(64*lo ...
- POJ 2446 Chessboard (二分图匹配)
题意 在一个N*M的矩形里,用1*2的骨牌去覆盖该矩形,每个骨牌只能覆盖相邻的两个格子,问是否能把每个格子都盖住.PS:有K个孔不用覆盖. 思路 容易发现,棋盘上坐标和为奇数的点只会和坐标和为偶数的点 ...
- erlang reduction
“首先明确一点,Erlang的process的调度是抢占式的,而非couroutine的协作式的.其次,Erlang早期版本是只有一个调度器,运行在一个线程上,随着erts的发展,现在erlang的调 ...
- Android 项目利用 Android Studio 和 Gradle 打包多版本APK
在项目开发过程中,经常会有需要打包不同版本的 APK 的需求. 比如 debug版,release版,dev版等等. 有时候不同的版本中使用到的不同的服务端api域名也不相同. 比如 debug_ap ...
- 实时通讯库 libre/librem/restund/baresip
http://www.creytiv.com/ 源码下载 libre Toolkit library for asynchronous network IO with protocol stacks ...
- WebView(网络视图)的两种使用方式
WebView(网络视图)能加载显示网页,可以将其视为一个浏览器.它使用了WebKit渲染引擎加载显示网页,实现WebView有以下两种不同的方法:第一种方法的步骤:1.在要Activity中实例化W ...