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的更多相关文章

  1. JSF 2 multiple select listbox example

    In JSF, <h:selectManyListbox /> tag is used to render a multiple select listbox – HTML select ...

  2. JSF 2 dropdown box example

    In JSF, <h:selectOneMenu /> tag is used to render a dropdown box – HTML select element with &q ...

  3. 目录窗口多选Multiple Select in Catalog Window or arccatalog

    目录窗口多选Multiple Select in Catalog Window or arccatalog 商务合作,科技咨询,版权转让:向日葵,135-4855__4328,xiexiaokui#q ...

  4. 实现两个select list box间item的移动和过滤

    <head> <title> </title> <!--Standard jQuery --> <script type="text/j ...

  5. html multiple select option 分组

    普通html方式展示<select name="viewType" style="width: 100%;height: 300px;" multiple ...

  6. [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 ...

  7. [XAF] How to represent an enumeration property via a drop-down box with check boxes

    https://www.devexpress.com/Support/Center/Example/Details/E689

  8. 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. – ...

  9. 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 ...

随机推荐

  1. HDU 3949 XOR(高斯消元)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3949 题意:给出一个长度为n的数列A.选出A的所有子集(除空集外)进行抑或得到2^n-1个数字,去重排 ...

  2. What's New for Visual C# 6.0

    https://msdn.microsoft.com/en-us/library/hh156499.aspx nameof You can get the unqualified string nam ...

  3. python学习中,list/tuple/dict格式化遇到的问题

    昨天上了python培训的第一课,学习了基础知识.包括类型和赋值,函数type(),dir(),id(),help()的使用,list/tuple/dict的定义以及内置函数的操作,函数的定义,控制语 ...

  4. sendmessage()模拟鼠标点击

    {鼠标软模拟:好处就是不会真的移动鼠标 开始按钮 坐标 x=386y=387 }sendmessage(hookHwnd,messages.WM_LBUTTONDOWN ,0,$0180017A); ...

  5. JasperReports+iReport在eclipse中的使用

    转载:http://blog.csdn.net/daming924/article/details/7402295 一.介绍1)它可以PDF,HTML,XML等多种形式产生报表或动态报表,在新版本还支 ...

  6. Oracle中创建视图

    Oracle的数据库对象分为五种:表,视图,序列,索引和同义词. 视图是基于一个表或多个表或视图的逻辑表,本身不包含数据,通过它可以对表里面的数据进行查询和修改.视图基于的表称为基表. 视图是存储在数 ...

  7. Linux LiveCD 的制作

    Knoppix,只需一张光盘, 就能够让我们在任何场所,随心所欲地使用 Linux1, 打破了操作系统只能先安装再使用的传统概念. Knoppix 最初的设计用途是教学,但由于这项技术很受欢迎,使得  ...

  8. Web Api 如何做上传文件的单元测试

    代码如下: //--------上传------------ HttpClient client = new HttpClient(); #region MultipartFormDataConten ...

  9. System.web.optimization 在 Asp.Net WebForm 中应用得注意了

    我们也可以在Asp.Net WebForm项目中去使用Optimization,去处理我们的资源文件,从而起到优化网站性能的效果,前端知识得从小事做起.但是在使用过程中我却发现了下面的问题. 第一步: ...

  10. LeetCode: 3SumClosest

    Title : Given an array S of n integers, find three integers in S such that the sum is closest to a g ...