> rootPage = activePage.getAncestor(startLevel);

OK. Certainly better. Makes sense. Thx.
 

> As for the JspWriter, maybe 'pageContext.getOut()'.

I tried to modify that SimpleNavigationTag class to work as an inner JSP
class, and to build and return the list as a StringBuffer, but after
fixing all the bugs, I wind up with a pair of NullPointerExceptions, so
gave up and assembled the code blocks into a procedural script. 

This worked, except the end of the code recalls the class so it can
build lists for the children. The script can't do that, so I only get
the first level. So the code really does need to be in a class.

I put the SimpleNavigationTag class back how it was (without building &
returning the StringBuffer), and passing that 3rd 'out' argument, but
pair of NullPointerExceptions comes back.

<%
SimpleNavigationTag2 snt = new SimpleNavigationTag2();

Content activePage_obj = Resource.getActivePage(request);
Content page_obj = activePage_obj.getAncestor(startLevel);
JspWriter out_obj = pageContext.getOut();

snt.drawChildren2(page_obj,activePage_obj,out_obj);
%>

With the code blocks outside their normal context, I ran into a lot of
problems with 'this.hideInNav' and 'this.openMenu', so changed to just
'hideInNav' & 'openMenu'. I don't see any calls to all the 'setter'
methods, or 'doEndTag()'. I'm not sure what will happen if I try to
implement my stripped down code as a class (so I can recall it to build
the child lists), but will give it a try.




----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to