📅  最后修改于: 2021-01-08 04:11:49             🧑  作者: Mango
它是使用按钮用户界面的多选组件。 组件用于创建多个按钮。它用于通过按钮获取用户输入。我们可以在JSF应用程序中创建它。它具有下表列出的各种属性。
Attribute | Default value | Return type | Description |
---|---|---|---|
id | null | String | It is an unique identifier of the component. |
rendered | true | Boolean | It is used to render component. It takes boolean value. |
binding | null | obejct | It is used to set an expression that maps to a server side UIComponent instance in a backing bean |
value | null | obejct | It is used to set value of the component referring to a List. |
converter | null | Converter/String | It is used to set text that defines a converter for the component. |
required | false | Boolean | It is used to make component as required |
widgetVar | null | String | It is a name of the client side widget. |
disabled | false | Boolean | It is used to disable the component. |
label | null | String | It is used to set user presentable name. |
onchange | null | String | It is used to execute script on value change. |
style | null | String | It is used to set inline CSS of the component. |
在下面的示例中,我们正在实现组件。本示例包含以下文件。
// manyButton.xhtml
PrimeFaces ManyButton
// ManyButton.java
package com.javatpoint;
import java.util.List;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class ManyButton {
private List selectedValue;
public List getSelectedValue() {
return selectedValue;
}
public void setSelectedValue(List selectedValue) {
this.selectedValue = selectedValue;
}
}
输出: