本文概述
- 样式类和皮肤参数
- 例子
样式类和皮肤参数 下表包含列表的样式类和相应的外观参数。
Class | Function | Skin Parameters | 映射的CSS属性 |
---|---|---|---|
.rf-ulst-itm | 它用于为无序列表中的项目定义样式。 | generalTextColor generalFamilyFont | 彩色字体系列 |
.rf-olst-itm | 它用于为无序列表中的项目定义样式。 | generalTextColor generalFamilyFont | color font-family |
.rf-dlst-trm | 它用于定义定义列表中项目术语的样式。 | generalTextColor generalFamilyFont | color font-family |
.rf-dlst-dfn | 用于定义定义列表中项目定义的样式。 | generalTextColor generalFamilyFont generalSizeFont | 颜色字体系列字体大小 |
JSF文件
// rich-list.xhtml
<
?xml version='1.0' encoding='UTF-8' ?>
<
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
ui:composition xmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:ui="http://java.sun.com/jsf/facelets"xmlns:a4j="http://richfaces.org/a4j"xmlns:rich="http://richfaces.org/rich">
<
f:view>
<
h:head>
<
title>
Rich List <
/title>
<
/h:head>
<
h:body>
<
h:form>
<
h:form>
<
rich:list var="student" value="http://www.srcmini.com/#{studentRecord.records}" type="definitions" rows="5" title="Cars">
<
f:facet name="term">
<
h:outputText value="http://www.srcmini.com/#{student.id}" styleClass="label">
<
/h:outputText>
<
/f:facet>
<
h:outputText value="http://www.srcmini.com/Name:" styleClass="label">
<
/h:outputText>
<
h:outputText value="http://www.srcmini.com/#{student.name}" />
<
br/>
<
h:outputText value="http://www.srcmini.com/Email:" styleClass="label">
<
/h:outputText>
<
h:outputText value="http://www.srcmini.com/#{student.email}" />
<
br/>
<
h:outputText value="http://www.srcmini.com/Contact:" styleClass="label">
<
/h:outputText>
<
h:outputText value="http://www.srcmini.com/#{student.contactNumber}" />
<
br/>
<
/rich:list>
<
/h:form>
<
/h:form>
<
/h:body>
<
/f:view>
<
/ui:composition>
托管豆
// StudentRecord.java
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean@RequestScopedpublic class StudentRecord {String id;
String name;
String email;
String contactNumber;
List<
StudentRecord>
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<
StudentRecord>
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<
StudentRecord>
records) {this.records = records;
}public int getNumberOfRecords(){return this.records.size();
} }
输出
文章图片
推荐阅读
- RichFaces rich(inputNumberSpinner)
- RichFaces rich(inputNumberSlider)
- RichFaces rich:inplaceSelect组件用法
- RichFaces rich(collapsibleSubTable用法示例)
- RichFaces rich:inplaceInput用法详解
- RichFaces rich(dropDownMenu用法示例)
- RichFaces rich(editor组件用法)
- RichFaces rich(dataTable组件)
- RichFaces rich(dataScroller用法示例)