Igor Vaynberg-2 wrote
> you should declare your Select2Choice as Select2Choice<Short> since
> that is its model type. once you do this the compiler will tell you
> that your TextChoiceProvider should be TextChoiceProvider<Short>
> instead of <HrpBbhepar5>
> -igor

In this case I can't search for description hence only the values are
displayed. Only I want to search for some text and get back it's id into a
Short field.

 private class Hepar5Provider extends TextChoiceProvider<Short> {

        protected String getDisplayText(Short choice) {
            return choice.toString();

        protected Object getId(Short choice) {
           return choice;

        public void query(String term, int page, Response<Short> response) {
            response.addAll(queryMatches(term, page, 10));
            response.setHasMore(response.size() == 10);
        public Collection<Short> toChoices(Collection<String> ids) {
            ArrayList<Short> hepar5idlist = new ArrayList<Short>();

            Iterator it = hepar5list.iterator();
            while (it.hasNext()) {
                HrpBbhepar5 h = (HrpBbhepar5) it.next();
            return hepar5idlist;

View this message in context: 
Sent from the Users forum mailing list archive at Nabble.com.

To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to