on 07-07-2005 9:35 PM
Hi all,
I am currently working on a project that involves a tree which can consist of about 800+ tree nodes based on the end-user's access rights. The main issue with this was the performance. In improving the performance, I created a new problem.
Here is the performance improvement:
At first, I read in all 800+ data and created the tree nodes in one initialization method. However, performance was so bad that I needed to redo the logic. I came up with the idea to render only the first level tree nodes first. Then on a user's expand/click of the tree nodes, the selected tree node will append its child nodes only for that selected tree node. This improves the performance dramatically.
Because of the new logic, I need to know which tree node is being selected. This is what I don't know how to do.
NOTE: I AM USING JSPDynPage.
-
Code:
// all root nodes is at menu level 1, these are the nodes
// which will be rendered on initialization
// menu level 2 will be appended on a user's click/expand
// action
if (menulevel == 1) // root node
{
TreeNode newNode = new TreeNode(id, name, parentnode);
newNode.setOnNodeExpand("RootNodeExpandEvent");
newNode.setOnNodeClick("RootNodeClickEvent");
}
// event handler
public void RootNodeClickEvent(Event event)
{
// i want to be able to determine which node
// is selected here
}
public void RootNodeExpandEvent(Event event)
{
// i want to be able to determine which node
// is selected here
}
-
I am fairly new to portal development. Gurus, please provide me with some of your knowledge on this issue. The deadline for the project is right around the corner.
Thanks in advance.
- Lay Gauv
Hi Lay,
You do the following.
public void RootNodeClickEvent(Event event)
{
TreeNodeSelectEvent nodeselect = (TreeNodeSelectEvent) event;
String node_key = nodeselect.getNodeKey();
}
public void RootNodeExpandEvent(Event event)
{
TreeNodeExpandEvent nodeselect = (TreeNodeExpandEvent) event;
String node_key = nodeselect.getNodeKey();
}
PS: Please reward points for helpful answer or problem resolved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eclipse automatically can put the following import statement. If you want you can manually put the following lines at the top.
import com.sapportals.htmlb.event.TreeNodeExpandEvent;
import com.sapportals.htmlb.event.TreeNodeSelectEvent;
email me at psingh@ust.net. I will send you my jar file. I think you might be using a old jar file.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.