cancel
Showing results for 
Search instead for 
Did you mean: 

An event about TreeView

Former Member
0 Kudos

Hi, everyone.

Below is my code:

<hbj:treeNode

d="NB_Acer_AMD"

text="AMD"

onNodeClick="onNode_AllGoods"

/>

I have already create a method 'onNode_AllGoods' in my JSPDynPage.

But it still has something wrong.

Can anyone help me solve this problem?

Or give me some example about TreeView.

Thx a lot o

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As you can see in the help of Tree view, we donot have HTMLB tags for certain operations. If the HTMLB tag for youor desired operation is not available then you have to go for development using classlib and Dynpage.

If you want to have the event onNodeClick then you have to develop your component using Dynpage.

Former Member
0 Kudos

thx. i got it.

Former Member
0 Kudos

Hi,

I am new to jsp.

I want to have a tree view on jsp page with the node click event. I have seen your post "An event about TreeView". Can you please send the working code with jsp file using the classlib instead of taglib?

I have no idea about how to start.

Can you help me out with this?

Regards,

Swetha

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

There is not HTMLB TAG for onNodeClick. This is given in the documentation for Treeview.

onNodeClick String (cs) Taglib

No tag available

Classlib

setOnNodeClick("onNodeClick")

If you have to use the onNodeClick then you have to go for classlib and Dynpage. I didn't check the HTMLB code i posted.

code

=====

Form form = (Form) this.getForm();

Tree tree = new Tree("S_Tree", "e-enviroment");

tree.setTooltip("enviroment of my computer");

TreeNode root = new TreeNode("e_root", "Desk");

root.setOpen(true);

root.setTooltip("My desk");

// Tags at the second level -

// the entries are defined with the event "onName"

// which is fired when the event is clicked.

TreeNode name1 = new TreeNode("e_comp", "Computer", root);

name1.setOnNodeClick("onName");

TreeNode name2 = new TreeNode("e_net", "Network", root);

name2.setOnNodeClick("onName");

TreeNode name11 = new TreeNode("e_comp_fl", "Floppy", name1);

name11.setOnNodeClick("onName");

TreeNode name12 = new TreeNode("e_comp_hd", "Harddisk", name1);

name12.setOnNodeClick("onName");

TreeNode name13 = new TreeNode("e_comp_dvd", "DVD", name1);

name13.setOnNodeClick("onName");

TreeNode name21 = new TreeNode("n_lan", "LAN", name2);

name21.setOnNodeClick("onName");

TreeNode name22 = new TreeNode("n_wan", "WAN", name2);

name22.setOnNodeClick("onName");

TreeNode name23 = new TreeNode("n_infra", "Infrared", name2);

name23.setOnNodeClick("onName");

tree.setRootNode(root);

form.addComponent(tree);

Former Member
0 Kudos

Hi, thx for your help.

Now i know that i can`t use htmlb tag to set onNodeClick.

But if i use Jsp DynPage and write the treeview in .jsp file.

How can i setup the treenode` event(onNodeClick)?

I have already tried to add the code

" treenode.setOnNodeClick("onNodeClick")" in my jsp file.

But it didn`t work.

Thx a lot o.

Former Member
0 Kudos

HI,

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/0c/9e0e41a346ef6fe10000000a1550b0/frameset.htm">Tree View</a>

Code

======

JSP

<%@ taglib uri="tagLib" prefix="hbj" %>

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<hbj:form id="myFormId" >

<hbj:tree

id="Tree1"

title="Available Worksets"

tooltip="Available Worksets"

>

<hbj:treeNode

id="root"

text="Desk"

isOpen="true"

tooltip="Start"

>

<hbj:treeNode

id="Node1"

text="Item1"

isOpen="true"

>

<hbj:treeNode

id="Item1_1"

text="floppy"

/>

<hbj:treeNode

id="Item1_2"

text="Harddisk"

/>

<hbj:treeNode

id="Item1_3"

text="CD"

/>

</hbj:treeNode>

<hbj:treeNode

id="Node2"

text="Item2"

isOpen="true"

tooltip="Item2"

>

<hbj:treeNode

id="Item2_1"

text="1" onNodeClick="Item1click" />

<hbj:treeNode

id="Item2_2"

text="2" />

<hbj:treeNode

id="Item2_3"

text="3" />

</hbj:treeNode>

</hbj:treeNode>

</hbj:tree>

</hbj:form>

</hbj:page>

</hbj:content>

JSPDYNPAGE

===============

package com.cts.anand;

import com.sapportals.htmlb.*;

import com.sapportals.htmlb.enum.*;

import com.sapportals.htmlb.event.*;

import com.sapportals.htmlb.page.*;

import com.sapportals.portal.htmlb.page.*;

import com.sapportals.portal.prt.component.*;

public class TreeView extends PageProcessorComponent {

public DynPage getPage(){

return new TreeViewDynPage();

}

public static class TreeViewDynPage extends JSPDynPage{

public void doInitialization(){

}

public void item1click(Event e) {

IPortalComponentResponse resp=null;

resp.write("Item1 Click");

}

public void doProcessAfterInput() throws PageException {

}

public void doProcessBeforeOutput() throws PageException {

this.setJspName("TreeJSP.jsp");

}

}

}

Former Member
0 Kudos

Hi, Kirupanand .

I still can`t run my iView sucessfully.

And i got the message which i s below:

Attribute 'onNodeClick' not found in tag library 'HTMLB' for the tag treeNode

I don`t know why i get it?