I've tried for 1 1/2 days to get this simple Drop Down to work and I'm
feeling stupid.  My mom tells me I'm smart.:-(

Everything works fine until I try to save it. I get the following error.  I
think it is trying to put the SelectOption object into the Model but I don't
know how to tell it to put the state var from SelectOption into my Vendor
object.




java.lang.UnsupportedOperationException: Model class
com.myprepress.pages.vendor.profile.VendorEntry$1 does not support
setObject(Object)

IModel vendorModel = new LoadableDetachableModel() {
                        protected Object load() {
                                return vendorDAO.load(tblId);
                                
                        }
                };

// add state
                ArrayList<SelectOption> states = new ArrayList<SelectOption>();
                states.add(new SelectOption("AL", "Alabama"));
                states.add(new SelectOption("OH", "Ohio"));
                states.add(new SelectOption("NY", "New York"));
                ChoiceRenderer choiceRenderer = new ChoiceRenderer("display", 
"state");

                DropDownChoice stateFC = new DropDownChoice("state", 
vendorModel, new
Model(states), choiceRenderer);


public class SelectOption implements Serializable {

        private String state;
        private String display;


-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-getting-value-into-the-model-tp15905486p15905486.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to