Hi
I try to mix JSP code with htmlb and it is not working as I want it to.
I try to create a tree with dynamic nodes, this using the htmlb tree which can be found in the documentation.
I open the tree static with:
<hbj:tree id="1" title="" rootNodeIsVisible="FALSE">
<hbj:treeNode id="rootinv" text="_" isOpen="TRUE">
I also close it later.
Inbetween I loop out the nodes and subnodes with the code:
<%if(Integer.parseInt(sMenuProdElements[k][3])==0){%>
<hbj:treeNode id="<%=p%>" text="<%=s%>" isOpen="FALSE">
<%}else if(Integer.parseInt(sMenuProdElements[k][3])==1){%>
<hbj:treeNode id="<%=p%>" text="<%=s%>"/>
<%}%>
I also have code for closing the treenode. I have tried with writing out plain text, so I know that it is writing the nodes in correct order.
How do I solve this issue. Should I save ready made htmlb code in the vector already in my dynpage and set it in the bean and then write it out in the JSP file. Anyone who had the similar problem who knows how to solve this issue?
Brgds// -Fred
What is the exact problem ? Do you get a compile exception or is the functionality not what you expected.
Remember that the id must be unique (and often it is better to use the javaclasses directly to build the tree structure instead of htmlb)
<b>Hi again</b>
The problem is that I can't use the java class and render the tree in the dynpage. I have a lot of other code for othter type of functionality in the iview that I don't want to rebuild. Have anyone got a clue how I should solve this. Implementing a dynamic tree, as I said above it does not work to mix JSP with htmlb in this case, maybe there is another way.
<b>
Brgds// -Fred</b>
Hi and thanks for your answers
It says that it expects while instead of if. So I changed this and used a different code snippet to read it all out and was successful! The tree is there.
But now I realised that there are no event handling in JSP taglib for the treeNode. Is this true, do I have to render the whole iview in dynpage in order to be able to use the eventhandling, or is there a workaround?
// -Fred
I know that it is possible to add onNodeClick to a treeNode using this code:
<hbj:treeNode id="hello" text="helloWorld"><% hello.setOnNodeClick("nodeSClick"); %></hbj:treeNode>
But this does not work for my solution, I'm looping all the values out and the id is dynamic. So, writing a code snippet that says:
<hbj:treeNode id="<%=vElem[0][1]%>" text="helloWorld"><% vElem[0][1].setOnNodeClick("nodeSClick"); %></hbj:treeNode>
Does not work. Anyone have any suggestions how to resolve this issue?
Brgds// -Fred
Add a comment