📅  最后修改于: 2021-01-08 12:27:21             🧑  作者: Mango
RichFaces提供了< rich:inplaceInput >组件,该组件用于创建可编辑的文本框。它允许以文本块的形式在线输入文本。它提高了文本的可读性。
它具有三个功能状态:
下表包含inplaceInput的样式类和相应的外观参数。
Class | Function | Skin Parameters | Mapped CSS properties |
---|---|---|---|
.rf-ii | It is used to define styles for the in-place input when it is in the default state. | editorBackgroundColor | background-color |
.rf-ii-act | It is used to define styles for the in-place input when it is in the editing state. | No skin parameters. | |
.rf-ii-chng | It is used to define styles for the in-place input when it is in the changed state. | No skin parameters. | |
.rf-ii-dis | It is used to define styles for the in-place input when it is in the disabled state. | No skin parameters. | |
.rf-ii-fld | It is used to define styles for the in-place input field. | editBackgroundColor generalTextColor |
background-color, border-bottom-color color |
.rf-ii-lbl | It is used to define styles for the label of the in-place input. | generalSizeFont | font-size |
.rf-ii-dflt-lbl | It is used to define styles for the default label of the in-place input. | No skin parameters. | |
.rf-ii-btn | It is used to define styles for the buttons for the in-place input. | tabBackgroundColor | background-color |
.rf-ii-btn-p | tabBackgroundColor | background-color | |
.rf-ii-btn-set, .rf-ii-btn-prepos, .rf-ii-btn-pos | It is used to define the positioning of the buttons. | No skin parameters. | |
.rf-ii-btn-shdw | It is used to define styles for the button shadows for the in-place input. | No skin parameters. | |
.rf-ii-btn-shdw-t, .rf-ii-btn-shdw-b, .rf-ii-btn-shdw-l, .rf-ii-btn-shdw-r | These classes define the top, bottom, left, and right edge of the button shadows. | No skin parameters. | |
.rf-ii-none | It is used to define styles for the in-place input when it cannot be edited. | No skin parameters. |
在下面的示例中,我们正在实现< rich:inplaceInput >组件。本示例包含以下文件。
// inplace-input.xhtml
InplaceInput Example
// User.java
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class User {
String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
输出:
现在,输入文字