Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/tree
In directory james.mmbase.org:/tmp/cvs-serv28424

Modified Files:
        TreeContainerTag.java 
Log Message:
  MMB-1668


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/tree
See also: http://www.mmbase.org/jira/browse/MMB-1668


Index: TreeContainerTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/tree/TreeContainerTag.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- TreeContainerTag.java       24 Jan 2008 14:20:35 -0000      1.12
+++ TreeContainerTag.java       27 Jun 2008 14:35:32 -0000      1.13
@@ -24,7 +24,7 @@
  *
  * @author Michiel Meeuwissen
  * @since  MMBase-1.7.1
- * @version $Id: TreeContainerTag.java,v 1.12 2008/01/24 14:20:35 michiel Exp $
+ * @version $Id: TreeContainerTag.java,v 1.13 2008/06/27 14:35:32 michiel Exp $
  */
 public class TreeContainerTag extends RelatedNodesContainerTag implements 
NodeQueryContainer, ContainerReferrer { // extending from relatednodescontainer 
only for the attributes
 
@@ -69,10 +69,14 @@
         String node      = nodeAttribute.getString(thisTag);
         if ("".equals(container) && "".equals(node)) {
             log.debug("no node attribute, no container attribute, trying 
container first");
+            Query q = (Query) 
thisTag.getPageContext().getAttribute(QueryContainer.KEY, QueryContainer.SCOPE);
+            if (q != null && (q instanceof NodeQuery)) query = (NodeQuery) q;
+            if (query == null) {
             NodeQueryContainer c = 
thisTag.findParentTag(NodeQueryContainer.class, null, false);
             if (c != null) {
                 query = c.getNodeQuery();
             }
+            }
         } else if (! "".equals(container)) {
             log.debug("container attribute, trying container");
             NodeQueryContainer c = 
thisTag.findParentTag(NodeQueryContainer.class, container, true);
@@ -99,6 +103,7 @@
     }
 
     public int doStartTag() throws JspTagException {
+        prevQuery= pageContext.getAttribute(QueryContainer.KEY, 
QueryContainer.SCOPE);
         // first of all, we need a 'start' query, take it from a surrounding 
'nodequery container'
 
         query = getStartQuery(this, container, parentNodeId);
@@ -127,6 +132,7 @@
         if (jspVar != null) {
             pageContext.setAttribute(jspVar, tree);
         }
+        pageContext.setAttribute(QueryContainer.KEY, getNodeQuery(), 
QueryContainer.SCOPE);
         return EVAL_BODY;
     }
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to