package jfix.zk;
import java.util.List;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.ListModelList;
import jfix.util.Validations;
public class Combobox extends org.zkoss.zul.Combobox {
public Combobox() {
setHflex("1");
}
public void setSelection(List values, String selected) {
setModel(new ListModelList(values));
if (selected != null) {
setValue(selected);
}
}
public boolean isEmpty() {
return Validations.isEmpty(getValue());
}
public void addSelectListener(final ActionListener actionListener) {
addEventListener(Events.ON_SELECT, new EventListener() {
public void onEvent(Event e) throws Exception {
actionListener.actionPerformed(e);
}
});
}
}