on 08-28-2005 4:43 PM
Hi All I have an htmlb tree control that shows the folders in the content management part of my SAP portal.
I create the tree in a Java bean using a recursive method to go through the folder structure
tree = new Tree("navTree");
tree.setOnTreeClick("treeClick");
this.setRoot(buildTree(request));
//buildTree is the recursive method, which appends child nodes
my jsp page then displays the tree like this
<%@ taglib uri="htmlb" prefix="hbj" %>
<%@page import="com.sapportals.htmlb.TreeNode"%>
<jsp:useBean id="navigationDataBean" scope="session" class="com.dfdstransport.portal.pub.externalweb.beans.NavigationDataBean" />
<table>
<tr>
<td align="left" valign="top" class="header1" style="background-image:url(img/dots-horizontal.gif); background-repeat:repeat-x; background-position:bottom;padding-bottom:3px"><%=navigationDataBean.getNavigationHeader()%></td>
</tr>
</table>
<hbj:content id="myContext" >
<hbj:page title="PageTitle">
<hbj:form id="myFormId" >
<table>
<tr>
<td width ="100">
<%
myFormId.addComponent(navigationDataBean.getTree());
%>
</td>
</tr>
</table>
</hbj:form>
</hbj:page>
</hbj:content>
no problem so far the tree is shown with the correct nodes.
my problem is that I want to control the width of the Tree so it has a fixed width, so if some node has a very long name it will be wrapped within the tree control.
but the tree control does not seem to have any width attribute either in java api or in htmlb tags.
I have found some forum post and blogs where people use something like
<htmlb:Tree
id="foo"
node="fooNode"
..
..
width="100"
/>
I am running on EP6 SP9, could that be a problem.
any help or ideas on how to control the width would be greatly appreciated
What I did was to insert a Htmlb Gridlayout with a htmlb link object in each treenode, setting the width of the gridlayout will wrap the nodes.
I do not like this solution for severel reasons:
You lose a lot of the functionality and layout provided by the tree which was the reason I choose to use it.
On my project we decided that the Htmlb tree was simply not fit to our solution, so we decided to make our own tree ising standard <ul><li> html tags
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
so if you set the width of the table to 100px and one of the nodes has a name that is 200 px long will it wrap the text inside the tree?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
-> setting the width of the tree...
yes that is excactly what I want to do but the control does not have any property called width
I tried putting the htmlb tree inside an html table and setting the width of the td, but that did not have any effect.
If you say you have done it can you show me some code example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ulrik,
U cud try with html table tags and set the width of the tree.
It worked for me..
Let me know if u need more..
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.