use of javax.portlet.WindowStateException in project uPortal by Jasig.
the class DirectoryPortletController method submitSearch.
@ActionMapping
public void submitSearch(ActionRequest request, ActionResponse response, @RequestParam(value = "query", required = false) String query) {
// Should we request to maximize?
PortletPreferences prefs = request.getPreferences();
boolean maximize = Boolean.parseBoolean(// default is true
prefs.getValue(MAXIMIZE_ON_SEARCH_PREFERENCE, "true"));
if (maximize) {
try {
response.setWindowState(WindowState.MAXIMIZED);
} catch (WindowStateException e) {
log.warn("Failed to set the window state to MAXIMIZED", e);
}
}
// Forward the query parameter...
if (query != null) {
response.setRenderParameter("query", query);
}
}
Aggregations