📅  最后修改于: 2021-01-08 12:45:50             🧑  作者: Mango
该组件的工作方式与
对于基本用法,它不需要任何其他属性。为了将消息限制为特定的组件,我们可以使用for属性来引用该组件。
下表包含消息的样式类和相应的外观参数。
Class (selector) | Function | Skin Parameters | Mapped CSS properties |
---|---|---|---|
.rf-msgs | It is used to define styles for the message itself. | generalFamilyFont generalSizeFont |
font-family font-size |
.rf-msgs-err | It is used to define styles for an error message. | errorColor | color |
.rf-msgs-ftl | It is used to define styles for a fatal message. | errorColor | color/td> |
.rf-msgs-inf | It is used to define styles for an information message. | generalTextColor | color |
.rf-msgs-wrn | It is used to define styles for a warning message. | warningTextColor | color |
.rf-msgs-ok | It is used to define styles for a basic OK message. | generalTextColor | color |
.rf-msgs-sum, .rf-msgs-det | These classes define styles for the summary or details of a message. | No skin parameters. |
在下面的示例中,我们正在实现< rich:messages >组件。本示例包含以下文件。
// rich-messages.xhtml
Rich Messages
// User.java
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class User {
String name;
String email;
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;
}
}
输出: