PrimeFaces JSF 组件库中有一个PickList 小部件?
GWT(或任何其他 GWT 组件库)是否有这样的小部件?
我更喜欢创建自己的 PickList,因为它简单明了,如下所示:
public abstract class PickList<T> extends Composite {
//The renderer provide the flexibility for client class customize the cell
public PickList(SafeHtmlRenderer<T> renderer) {
...
}
public void setCandidates(List<T> candidates, List<T> selected) {
//todo
}
public List<T> getSelectedValues() {
//todo
}
//Below two abstract method can facilitate getting values from view or rendering view from value
protected abstract T fromIdentity(String identity);
protected abstract String toIdentity(T value);
}