📜  RichFaces Rich:List

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

RichFaces

此组件用于呈现项目列表。我们可以创建数字排序列表,无序列表,项目符号列表等。它使用数据模型来管理可以动态更新的列表项。

样式类和皮肤参数

下表包含列表的样式类和相应的外观参数。

Class Function Skin Parameters Mapped CSS properties
.rf-ulst-itm It is used to define styles for an item in an unordered list. generalTextColor
generalFamilyFont
color
font-family
.rf-olst-itm It is used to define styles for an item in an unordered list. generalTextColor
generalFamilyFont
color
font-family
.rf-dlst-trm It is used to define styles for the term of an item in a definition list. generalTextColor
generalFamilyFont
color
font-family
.rf-dlst-dfn It is used to define styles for the definition of an item in a definition list. generalTextColor
generalFamilyFont
generalSizeFont
color
font-family
font-size

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

JSF文件

// rich-list.xhtml






Rich List 












托管豆

// StudentRecord.java

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class StudentRecord {
String id;
String name;
String email;
String contactNumber;
List records;
public StudentRecord(){}
public StudentRecord(String id, String name, String email, String contactNumber) {
this.id = id;
this.name = name;
this.email = email;
this.contactNumber = contactNumber;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
public List getRecords() {
records = new ArrayList<>();
records.add(new StudentRecord("101", "Raju", "raju@abc.com", "52534252"));
records.add(new StudentRecord("102", "Rama", "rama@abc.com", "52235252"));
records.add(new StudentRecord("103", "John", "john@abc.com", "52456252"));
records.add(new StudentRecord("104", "Peter", "peter@abc.com", "55625252"));
return records;
}
public void setRecords(List records) {
this.records = records;
}
public int getNumberOfRecords(){
return this.records.size();
} 
}

输出: