*/
@Override
protected void onSubmit()
{
ExampleApplication selected = (ExampleApplication)ddc.getModelObject();
PortletRequestContext prc = (PortletRequestContext)RequestContext.get();
PortletPreferences prefs = prc.getPortletRequest().getPreferences();
prc.getPortletRequest().getPortletSession().setAttribute(
WicketExamplesMenuPortlet.EXAMPLE_APPLICATION_ATTR, selected);
try
{
((ActionResponse)prc.getPortletResponse()).setPortletMode(PortletMode.VIEW);
prefs.setValue(WicketExamplesMenuPortlet.EXAMPLE_APPLICATION_PREF, selected
.getFilterPath());
prefs.store();
}
catch (Exception pe)
{
throw new RuntimeException(pe);
}
}
};
List examples = WicketExamplesMenuApplication.getExamples();
ddc = new DropDownChoice("examples", examples, exampleChoiceRenderer);
ddc.setNullValid(false);
PortletRequestContext prc = (PortletRequestContext)RequestContext.get();
String eaFilterPath = prc.getPortletRequest().getPreferences().getValue(
WicketExamplesMenuPortlet.EXAMPLE_APPLICATION_PREF, null);
Model selected = new Model((ExampleApplication)examples.get(0));
if (eaFilterPath != null)
{
for (int i = 0, size = examples.size(); i < size; i++)