/** @see javax.servlet.jsp.tagext.BodyTagSupport#doStartTag() */ public int doStartTag() throws JspException { final String pageAccess = (String) pageContext.getAttribute("access"); if ((pageAccess != null) && pageAccess.equals(Access.READONLY) && !forceReadWrite) { return SKIP_BODY; } // Recherche si un parent est du bon type Tag curParent = null; for (curParent = getParent(); (curParent != null) && !(curParent instanceof ColsTag); ) { curParent = curParent.getParent(); } if (curParent == null) { throw new JspException("ColTag must be used between Cols Tag."); } colsTag = (ColsTag) curParent; if (!GenericValidator.isBlankOrNull(colsTag.getEmptyKey()) && (pageContext.getAttribute(colsTag.getId()) == null)) { return SKIP_BODY; } else { return EVAL_PAGE; } }
/** @see javax.servlet.jsp.tagext.Tag#doEndTag() */ public int doEndTag() throws JspException { final String pageAccess = (String) pageContext.getAttribute("access"); if ((pageAccess != null) && pageAccess.equals(Access.READONLY) && !forceReadWrite) { return SKIP_BODY; } // Recupere la locale de la page final Locale localeRequest = (Locale) pageContext.getSession().getAttribute(Globals.LOCALE_KEY); // Recuperer le fichier des Bundle final MessageResources resources = (MessageResources) pageContext.getServletContext().getAttribute(Globals.MESSAGES_KEY); final ColSelect c = new ColSelect(); if (key == null) { key = "selected"; } c.setKey(key); c.setProperty(property); c.setWidth(width); c.setPageContext(pageContext); c.setEnableSingleSelect(enableSingleSelect); c.setWriteTD(false); c.setOnclick(onclick); c.setDisabledProperty(disabledProperty); c.setSpecialHeader(showSelectAllHeader); c.setSpecialHeaderTitle( resources.getMessage(localeRequest, "welcom.internal.selectAll.tootip")); c.setToolTip(resources.getMessage(localeRequest, toolTipKey)); if (GenericValidator.isBlankOrNull(c.getToolTip())) { c.setToolTip(toolTipKey); } if (getBodyContent() != null) { c.setCurrentValue(getBodyContent().getString().trim()); } colsTag.addCellule(c); return EVAL_PAGE; }