I'm trying to create a DropDownChoice select list based on a List of entity beans I'm pulling from EJB3.  I'm following the example in the wicket-examples code but it's not working for me.

I'm try do to it this way, per the example code:

            add(new DropDownChoice("productCategory", catsModel, new IChoiceRenderer())
            {
                public String getDisplayValue(Object object)
                {
                    return ((ProductCategory)object).getName();
                }
               
                public String getIdValue(Object object, int index)
                {
                    return String.valueOf(((ProductCategory)object).getCategoryId());
                }
            });

...but eclipse is giving me an error and it won't compile:

"Cannot instantiate the type IChoiceRenderer"

And, just taking it out causes the objects' .toString() to be returned...as expected:

            add(new DropDownChoice("productCategory", catsModel)
            {
                public String getDisplayValue(Object object)
                {
                    return ((ProductCategory)object).getName();
                }
               
                public String getIdValue(Object object, int index)
                {
                    return String.valueOf(((ProductCategory)object).getCategoryId());
                }
            });

So...what do I do?  IChoiceRender is a class, how can I instantiate it like a class per the wicket-examples DropDownChoice.java example code?

Thanks!

Reply via email to