📜  RichFaces Rich:Picklist

📅  最后修改于: 2021-01-08 12:33:07             🧑  作者: Mango

RichFaces

它用于从列表中选择项目。它允许我们在客户端更改所选项目的顺序。我们可以从源列表中添加项目,也可以从目标列表中删除项目,反之亦然。但是,重要的是要注意,服务器端项目的源不会修改。

样式类和皮肤参数

下表包含pickList的Style类和相应的外观参数。

Class Function Skin Parameters Mapped CSS properties
.rf-pick It is used to define styles for the pickList control itself. No skin parameters.
.rf-pick-src-cptn, .rf-pick-tgt-cptn These classes define styles for the source and target captions of the pickList control. headerTextColor
headerSizeFont
color
font-size
.rf-pick-lst It is used to define styles for the items list of the pickList control. No skin parameters.
.rf-pick-hdr It is used to define styles for the header of the items list. headerBackgroundColor
headerTextColor
background-color
color
.rf-pick-opt It is used to define styles for an option in the pickList control. generalTextColor
generalSizeFont
color
font-size
.rf-pick-sel It is used to define styles for the selected option of the pickList control. generalTextColor border-color
.rf-pick-dflt-lbl It is used to define styles for the default label of the pickList control. No skin parameters.
.rf-pick-btn It is used to define styles for the button of the pickList control. headerBackgroundColor
panelBorderColor
background-color
border-left-color
.rf-pick-btn-dis It is used to define styles for the button of the pickList control when it is disabled. No skin parameters.
.rf-pick-lst-scrl It is used to define styles for the list scrollbar. No skin parameters.

在下面的示例中,我们正在实现< rich:pickList >组件。本示例包含以下文件。

JSF文件

// pickList.xhtml






Pick List Example





托管豆

// PickList.java

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class PickList {
String CountryName;
List list;
public List countryList() {
ArrayList list = new ArrayList<>();
list.add("India");
list.add("Australia");
list.add("Germany");
list.add("Italy");
list.add("United States");
list.add("Russia");
return list;
}
public String getCountryName() {
return CountryName;
}
public void setCountryName(String CountryName) {
this.CountryName = CountryName;
}
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
}

输出: