📜  Primefaces滑块

📅  最后修改于: 2021-01-08 04:17:32             🧑  作者: Mango

PrimeFaces滑杆

它是带有滑块的文本输入。它用于在滑块的帮助下获得用户输入。它允许我们使用滑块增加和减少输入。 组件用于创建滑块输入文本。它还具有下表列出的各种属性。

滑块属性

Attribute Default value Type Description
minValue 0 Integer It is used to set minimum value of the slider.
maxValue 100 Integer It is used to set maximum value of the slider.
style null String It is used to set inline CSS of the container element.
animate true Boolean It takes boolean value to set enable or disable of the animate feature.
type horizontal String It is used to set type of slider. Whether it is horizontal or vertical.
step 1 Integer It is used to set steps for the slider.
disabled 0 Boolean It is used to disable slider. It takes boolean value.
onSlideStart null String It is used to call client script on slider start event.
onSlideEnd null String It executes client script on slide end.
range false Boolean It is used to provide range.
displayTemplate null String It is a string template.

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

JSF文件

// slide.xhtml





Input Slider




PrimeFaces InputText Slider


ManagedBean

// Slider.java

package com.javatpoint;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class Slider {
private int value;
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}

输出: