The following patch applies on top of the previous one and solves another bug.
Decorators are specified in the body so the decorators we output in doStartTag will never be shown. Also one has to have extra care that decorators are only added during the ENUMERATE command, so we move the output of the beginning of the list to this state. Lastly we also fix a non-reinitialized variable in release() (Do not apply, goes to the branch)
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java index ee03aa9..05c04d1 100644 --- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java +++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java @@ -734,6 +734,24 @@ public class ListTag extends BodyTagSupport { return BodyTagSupport.SKIP_BODY; } + private void doAfterBodyRenderListBegin() throws JspException { + ListTagUtil.write(pageContext, "<!-- START LIST " + getUniqueName() + " -->"); + + String listId = (getStyleId() != null) ? getStyleId() : getUniqueName(); + + for (ListDecorator dec : getDecorators()) { + dec.beforeList(); + } + + ListTagUtil.write(pageContext, "<div class=\"spacewalk-list"); + if (styleClass != null) { + ListTagUtil.write(pageContext, " " + styleClass); + } + ListTagUtil.write(pageContext, "\" id=\"" + listId + "\">"); + ListTagUtil.setCurrentCommand(pageContext, getUniqueName(), + ListCommand.TBL_HEADING); + } + /** * ${@inheritDoc} */ @@ -750,8 +768,7 @@ public class ListTag extends BodyTagSupport { setState(); if (haveColsEnumerated && !haveTblHeadingRendered) { - ListTagUtil.setCurrentCommand(pageContext, getUniqueName(), - ListCommand.TBL_HEADING); + doAfterBodyRenderListBegin(); } else if (haveColsEnumerated && !haveTblAddonsRendered) { doAfterBodyRenderTopAddons(); @@ -829,22 +846,8 @@ public class ListTag extends BodyTagSupport { manip = new DataSetManipulator(pageSize, pageData, (HttpServletRequest) pageContext.getRequest(), getUniqueName(), isParentAnElement(), searchParent, searchChild); - - ListTagUtil.write(pageContext, "<!-- START LIST " + getUniqueName() + " -->"); - - String listId = (getStyleId() != null) ? getStyleId() : getUniqueName(); ListTagUtil.setCurrentCommand(pageContext, getUniqueName(), - ListCommand.ENUMERATE); - - for (ListDecorator dec : getDecorators()) { - dec.beforeList(); - } - - ListTagUtil.write(pageContext, "<div class=\"spacewalk-list"); - if (styleClass != null) { - ListTagUtil.write(pageContext, " " + styleClass); - } - ListTagUtil.write(pageContext, "\" id=\"" + listId + "\">"); + ListCommand.ENUMERATE); return BodyTagSupport.EVAL_BODY_INCLUDE; } @@ -931,6 +934,7 @@ public class ListTag extends BodyTagSupport { haveColHeadersRendered = false; haveTblAddonsRendered = false; haveTblFootersRendered = false; + haveTblHeadingRendered = false; getDecorators().clear(); decorators = null; decoratorName = null;
_______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel