Skip to Content
author's profile photo Former Member
Former Member

HTMBL tree

I want to dynamically create tree with HTBLB tree tag. I create simple example:

<%@ page contentType="text/html; charset=UTF-8" %>

<%@ taglib uri="tagLib" prefix="hbj" %><hbj:content id="myContext" >

<hbj:page title="Test tree">

<hbj:form id="myFormId">

<hbj:tree id="S_Tree"

tooltip="Test tree"

>

<%

for (int i = 0; i < 10; i++)

{

System.out.println(i);

%>

<hbj:treeNode

id="eee<%= i %>"

text="Test <%= i %>!">

<hbj:treeNode

id="ddd<%= i %>"

text="Test <%= i %>!">

</hbj:treeNode>

</hbj:treeNode>

<% }

%>

</hbj:tree>

</hbj:form>

</hbj:page>

</hbj:content>

In result I have only one root node. Cycle is ignored by tree tag! It means that tree tag can not be used on dynamic JSP pages? It is very poorly...

It means that I should create this tree manually 😔 But I can't reconstruct portal style exactly...

Message was edited by: Eugeny Balakhonov

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2004 at 12:56 PM

    Thanks!

    But I have new problem. I want to catch click events on tree nodes in single method. I tries to add code like

    node.setOnNodeClick("onSelectNode");

    for each node in my tree

    But I can't receive node id in onSelectNode routine:

    public void onSelectNode(Event event)

    {

    ...

    }

    Event object hasn't any information about which node was selected and tree object hasn't information too.

    I can't find any information in HTMLB documentation.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 13, 2004 at 11:21 AM

    Why no generate the Tree using the Tree Model. By doing this you can have the logic for designing the dynamic tree in the controller class (DynPage or AbstractPortalComponent) and then the JSP page has a simple Tree tag pointing to the model

    This should be documented in the PDK documentation on how to use models within DynPages

    I hope this helps

    Darrell

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2004 at 11:28 AM

    the problem in this coding is that id="eee<%= i %>" jsp expresssion - you can't put that together this way in jsp. A rtxprevalue must either be an expression or a fixed value, so this will be correct:

    id='<%="eee"+ i %>'

    Same holds for all the other attributes. In addition to this, you may have problems because of the multiple root nodes that you produce. You probably better loop inside a root treeNode tag, not inside the tree node tag itself.

    Regards,

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2004 at 01:16 PM

    I am grateful very much! Thanks!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.