/** * Sets the filter used to filter list data * * @param filterIn name of the filter class to use * @throws JspException error occurred creating an instance of the filter */ public void setFilter(String filterIn) throws JspException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Class klass = cl.loadClass(filterIn); filter = (ListFilter) klass.newInstance(); Context threadContext = Context.getCurrentContext(); filter.prepare(threadContext.getLocale()); } catch (Exception e) { throw new JspException(e.getMessage()); } }
/** @param f the filter to set */ void setColumnFilter(ListFilter f) throws JspException { if (filter != null) { String msg = "Cannot set the column filter - [%s], " + "since the table has been has already assigned a filter - [%s]"; throw new JspException(String.format(msg, String.valueOf(f), String.valueOf(filter))); } filter = f; Context threadContext = Context.getCurrentContext(); filter.prepare(threadContext.getLocale()); manip.filter(filter, pageContext); }