1

There is a PickList widget in PrimeFaces JSF component library?

Does GWT (or any other GWT component library) has such a widget?

Bourbia Brahim
  • 14,459
  • 4
  • 39
  • 52
Halil
  • 1,795
  • 1
  • 24
  • 39

2 Answers2

2

Have a look at SmartGWT's featured example on Databound Dragging. You can also view its source. But since gwt does not have such widget, the best solution is to create your own custom component with the help of CellList.

JN ERC
  • 295
  • 1
  • 3
  • 14
  • I was looking for the same thing and I couldn't find anything good so I made my own with `CellList`. – enrybo Oct 18 '13 at 19:13
  • This answer looks useful since SmartGWT's widget provides what I am looking for. But, since I'm using gwt-bootstrap, switching to SmartGWT does not seem practical for my case. – Halil Oct 19 '13 at 10:15
0

I prefer to create my own PickList as it's easy and straightforward, below is what it looks like:

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);
}
Mike
  • 3,515
  • 10
  • 44
  • 67