-
1. Re: Facing problem with rich Tree and need help.
ilya_shaikovsky Feb 9, 2009 6:54 AM (in response to eldawayaty)yes.. screenshot will be helpfull.(share at any image sharing server) I'm not sure that get the point completelly. Also provide java code of tree initialization.
-
2. Re: Facing problem with rich Tree and need help.
eldawayaty Feb 14, 2009 2:34 AM (in response to eldawayaty)here is the source code for building the tree.
i can't see any thing wrong with it.
// this will get the tree data from the Database
List rs = DatabaseAPI.executeQuery(queryStr, 5, queryDataTypes);
// TestTreeNode is a class extends org.richfaces.model.TreeNodeImpl
this.node = new TestTreeNode();
String a_name, jspname;
if (rs.size() > 0) {
int iterator = 0;
int i = 1;
int parent = 0;
int code = 0;
boolean rootFlag = false;
try {
TestTreeNode root = null;
TestTreeNode level1 = null;
TestTreeNode level2 = null;
while (iterator < rs.size()) {
a_name = (String)(((List)(rs.get(iterator))).get(1));
jspname = (String)(((List)(rs.get(iterator))).get(2));
code = (Integer)(((List)(rs.get(iterator))).get(0));
if ((((Integer)(((List)(rs.get(iterator))).get(3))) == 0 ) && (rootFlag == false)){
root = new TestTreeNode();
root.setData(a_name);
parent = -1;
rootFlag = true;
} else {
if ((String)(((List)(rs.get(iterator))).get(2)) == null) {
level1 = new TestTreeNode();
level1.setData(a_name);
root.addChild(iterator,level1);
} else {
level2 = new TestTreeNode();
level2.setData(a_name);
if (!sessionInfo.isTreeLinkable())
if((Integer)(((List)(rs.get(iterator))).get(4)) == 1 )// the link is enabled
level2.setLink((String)(((List)(rs.get(iterator))).get(2)));
else
level2.setLink("/ETransactions/Sorry.html");
level1.addChild(iterator,level2);
}
}
iterator++;
i++;
}
if (root == null){
root = new TestTreeNode();
root.setData("??????? ????????");
}
node.addChild(0,root);
} catch (Exception ex) {
// TODO
System.out.println(ex.getMessage());
}
}
return node;
the problem that show up is (the result of this code):
1- there is an empty space (about one node hight) between the last tree node and the previous node in any level (i.e. if you expand any node at any level all the child nodes will show up in adjacent places except the last one, there will be an empty space between it and the previous node).
some thing like that:
- 1
- 1.1
- 1.2
- 1.2.1
- 1.2.2
- 1.2.3
- 1.3
- 1.4
as you can see the space between 1.2.3 and 1.2.2
also the same with 1.4 and 1.4. -
3. Re: Facing problem with rich Tree and need help.
nbelaevski Feb 14, 2009 9:01 AM (in response to eldawayaty)Hello,
In what browser does that reproduce? And what is RF version? -
4. Re: Facing problem with rich Tree and need help.
eldawayaty Feb 15, 2009 2:21 AM (in response to eldawayaty)this problem on the folowing environment
IE, RichFaces 3.1.6 GA, MyFaces 1.1.5, OC4j 10.1.3.3.0 with JDK 1.5_6
i think that's all. -
5. Re: Facing problem with rich Tree and need help.
nbelaevski Feb 16, 2009 1:21 PM (in response to eldawayaty)I cannot reproduce the issue on 3.1.6.GA livedemo: http://livedemo.exadel.com/richfaces-demo-3.1.6.GA/richfaces/tree.jsf?c=tree. Do you have some custom styling enabled for P HTML element?