* @throws JspException when errors occur when processing this tag's attribute values
*/
public void doTag()
throws JspException {
DataGridTagModel dgm = DataGridUtil.getDataGridTagModel(getJspContext());
if(dgm == null)
throw new JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel"));
PagerModel pm = dgm.getState().getPagerModel();
assert pm != null;
if(_disableDefaultPager != null)
dgm.setDisableDefaultPagerRendering(_disableDefaultPager.booleanValue());
if(_pageSize != null)
pm.setPageSize(_pageSize.intValue());
if(_defaultPageSize != null)
pm.setDefaultPageSize(_defaultPageSize.intValue());
PagerRenderer pagerRenderer = null;
if(_pagerRendererClass != null) {
try {
pagerRenderer = (PagerRenderer)ExtensionUtil.instantiateClass(_pagerRendererClass, PagerRenderer.class);
assert pagerRenderer != null : "Expected a non-null pager renderer of type \"" + _pagerRendererClass + "\"";
}
catch(DataGridExtensionException e) {
String msg = Bundle.getErrorString("ConfigurePager_CantCreateCustomPagerRenderer", new Object[]{e});
JspException jsp = new JspException(msg, e);
// todo: future cleanup
// The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
// this will cause an IllegalStateException on the following call.
if (jsp.getCause() == null) {
jsp.initCause(e);
}
throw jsp;
}
}
else if(_pagerFormat != null) {
if(_pagerFormat.equals(PAGER_FORMAT_FIRST_LAST_PREV_NEXT))
pagerRenderer = new FirstPreviousNextLastPagerRenderer();
else if(_pagerFormat.equals(PAGER_FORMAT_PREV_NEXT))
pagerRenderer = new PreviousNextPagerRenderer();
else
throw new JspException(Bundle.getErrorString("ConfigurePager_UnsupportedPagerFormat", new Object[]{_pagerFormat}));
}
if(pagerRenderer != null)
dgm.setPagerRenderer(pagerRenderer);
if(_pageHref != null && _pageAction != null)
throw new JspException(Bundle.getErrorString("ConfigurePager_CantSetHrefAndAction"));
if(_pageHref == null && _pageAction == null) {