We have a shared Panel containing a dropdown.

The Panel is used on 2 different pages where each page has its own model as
an associated bean POJO class. My problem is that I have to pre-select the
dropdown in the panel to a certain index.

Normally, this is done by setting a Model value. I can't do that here
because I don't store the beans and I don't do setModel(..) on them.

This doesn't work either, because the form hasn't been submitted yet and
getModelObject() is NULL:

                Object modelObject = 
((Form)(this.getParent())).getModelObject();
                if (modelObject.getClass().getName().endsWith("Bean_A"))
                        
((Bean_A)modelObject).setVerPeriod(optionsVerPeriod.get(vPeriodIndex));
                else
                        
((Bean_B)modelObject).setVerPeriod(optionsVerPeriod.get(vPeriodIndex));

Any ideas? Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Pre-Selecting-Dropdown-from-Shared-Panel-serving-2-Model-Databeans-tp4661306.html
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