如何在BackBean中使用SelectMany 对象
来源:互联网 发布:网络销售怎么找客户聊 编辑:程序博客网 时间:2024/06/14 00:27
This page was made fast and I hope don't be a nuisance to someboby
首先我们定义backbean来管理我们的 selectMany "list" :
<managed-bean> <managed-bean-name>Manager</managed-bean-name> <managed-bean-class>demo.Manager</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-bean>
现在Manager类应该有个 SelectMany object来管理信息;
package demo;
import javax.faces.component.UISelectMany;
import javax.faces.component.UIComponent;
class Manager{
private UISelectMany list;
/*
* Here we must create our list of objects
* obviously we may add a cycle "while" or "for"
* if we wouldn't know the number of items
*/
public UIComponentBase getList(){
list=new UISelectMany();
SelectItem item = new SelectItem( "value", "Description" );
UISelectItem uiItem = new UISelectItem();
uiItem.setValue( item );
list.getChildren().add( uiItem );
return list;
}
public void setList(UIComponentBase list){
this.list=(UISelectMany)list;
}
public void actionListener(ActionEvent ev){
Object obj [] = list.getSelectedValues();
// obj is an array of string that contents the values of our selectItems
}
}
JSP页面的代码如下:
<h:selectManyMenu binding="#{Manager.list}">
如果你想使用CheckBox or a ListBox仅仅在JSF文件中该变标签就可以了.如 <h:selectManyCheckBox> by either <h:selectManyListbox> or <h:selectManyCheckbox>, it is great!!
WRITTEN BY JOSE HERNAN VALDES MURGUIA. CBBA-BOLIVIA.
Hitoriki in jsf's java's forum
- 如何在BackBean中使用SelectMany 对象
- Spirng 整合jsf backBean对象
- 如何在ado中使用connection 对象?
- 如何在ado中使用connection 对象?
- 如何在ado中使用connection 对象?
- SelectMany
- 在Excel VBA中如何能够使用ADODB对象?
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引
- LINQ的经典例子-Where,Select、SelectMany、SkipWhile子句中使用数组索引 收藏
- 如何在PPT使用对象
- 如何在Tomcat中配置数据源?如何使用其数据源对象?
- 在对象中使用定时器
- 深入剖析C#继承机制(5)
- 深入剖析C#继承机制(6)
- 2007上半年系统分析师试题分析
- 动态增加和删除多个web用户控件
- Fedora core 4使用手记
- 如何在BackBean中使用SelectMany 对象
- 深入剖析C#继承机制(7)
- AIX5使用笔记
- JAVASCRIPT:响应LOGOUT
- 如何从Faces Context中得到当前的view id?
- BSP 概念解析
- 电脑生死录
- 使用backing bean来添加UIComponents 到页面中?
- 供应商关系管理(SRM)的基本内涵