public ActionForward execute(ActionMapping mapping, E form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (log.isDebugEnabled())
log.debug("list action");
ActionMessages errors = new ActionMessages();
Panel panel = Panel.getPanelStack(request).peek();
boolean formCached = false;
if(panel == null || !getPanelName().equals(panel.getName())) {
panel = createPanel(form, request, response);
panel.setName(getPanelName());
Panel.getPanelStack(request).push(panel);
}
if(!form.getDoSearch().isSelected()
&& !form.getDoResetSearch().isSelected()
&& !isAdditionalButtonUsed(form)
&& form.getSort() == null
&& form.getOrder() == null
&& form.getPage() == 0
&& panel.getAttribute(FORM_KEY) != null) {
if(log.isDebugEnabled())
log.debug("load form from panel");
form = (E)panel.getAttribute(FORM_KEY);
formCached = true;
request.setAttribute(mapping.getAttribute(), form);
} else if (panel.getAttribute(FORM_KEY) != null) {
if(log.isDebugEnabled())
log.debug("merge form with cached form");
E cacheForm = (E)panel.getAttribute(FORM_KEY);
if(form.getSort() == null)
form.setSort(cacheForm.getSort());
if(form.getPage() == 0)
form.setPage(cacheForm.getPage());
}
search(panel, form, formCached, errors, request, response);
form.setDoSearch(new ImageButtonBean());
form.setDoResetSearch(new ImageButtonBean());
panel.setAttribute(FORM_KEY, form);
if(!errors.isEmpty())
this.saveErrors(request, errors);
return findForward(mapping, form, request, response);