cancel
Showing results for 
Search instead for 
Did you mean: 

Tree event handling

0 Kudos

Hi,

I had a Tlayout.In that the left view is a Tree. When I clicked a particular element in the Tree on the left View I want the details of it to be displayed in the right View. What is the code for handling the click event of a tree and load a view corresponding to the clicked element and display it in right view.

Thanks in Advance

Safeer.I

Accepted Solutions (1)

Accepted Solutions (1)

former_member365727
Active Contributor
0 Kudos

Hi Safeer,

Refer to the below document, which has all the steps for creating a Tree. This tutorial is similar to the query you have posted,which involves a user click and the corresponding name will appear.

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/constructing%20a%20recursive%20and%20loadable%20web%20dynpro%20tree.pdf">Constructing a Recursive Loadable WebDynpro Tree</a>

Please close the other thread which is same is this one.

Regards

Srikanth

0 Kudos

Hi SriKanth,

I had already readed that Tutorial.

I like to know what we have to do to display another view on the Tlayout right side when we clicked the element of the tree.

Safeer.I

Former Member
0 Kudos

Just navigate to the view i.e. call the fire<OutboundPlug>() method.

Armin

former_member365727
Active Contributor
0 Kudos

Hi Safeer,

As mentioned by Armin, fire the outbound plug...

Regards

Srikanth

Answers (2)

Answers (2)

0 Kudos

Hi,

Thanks Armin and Srikanth

My problem is solved .

The Problem is with the line

IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNode");

The error was I gave ID name different in Tree UI properties and in getElement().

I gave the same name. It is now working fine.

I had given two points for both of U

Thanks and regards,

Safeer.I

0 Kudos

Thanks Srikanth and Armin.

Safeer .I

former_member365727
Active Contributor
0 Kudos

Hi Safeer,

If the issue is resolved, close this thread.

Regards

Srikanth

0 Kudos

When I run the app there is an error in wdDoModifyView()

in the line

treeNode.mappingOfOnAction().addSourceMapping("path","selectedElement");

and selectedElement is declared in the Actions parameter.

Safeer.I

former_member365727
Active Contributor
0 Kudos

Hi Safeer,

can u paste the error description.....

Regards

Srikanth

0 Kudos

Error Summary

While processing the current request, an exception occured which could not be handled by the application or the framework.

If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).

Root Cause

The initial exception that caused the request to fail, was:

java.lang.NullPointerException

at hbs.saf.TreeTut1View.wdDoModifyView(TreeTut1View.java:234)

at hbs.saf.wdp.InternalTreeTut1View.wdDoModifyView(InternalTreeTut1View.java:220)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)

at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:308)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)

... 27 more

See full exception chain for details.

System Environment

Client

Web Dynpro Client Type HTML Client

User agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

Version null

DOM version null

Client Type msie6

Client Type Profile ie6

ActiveX enabled

Cookies enabled

Frames enabled

Java Applets enabled

JavaScript enabled

Tables enabled

VB Script enabled

Server

Web Dynpro Runtime Vendor: SAP, build ID: 7.0007.20060331081328.0000 (release=645_VAL_REL, buildtime=2006-03-31:06:24:04[UTC], changelist=396896, host=pwdfm101), build date: Wed Mar 28 16:13:15 GMT+05:30 2007

J2EE Engine No information available

Java VM Java HotSpot(TM) Server VM, version:1.4.2_12-b03, vendor: Sun Microsystems Inc.

Operating system Windows 2003, version: 5.2, architecture: x86

Session & Other

Session Locale en_US

Time of Failure Tue Jul 31 11:10:50 GMT+05:30 2007 (Java Time: 1185860450203)

Web Dynpro Code Generation Infos

local/TreeTut1

SapDictionaryGenerationCore 7.0009.20060802115015.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:24:21[UTC], changelist=413123, host=PWDFM101.wdf.sap.corp)

SapDictionaryGenerationTemplates (unknown)

SapGenerationFrameworkCore 7.0009.20060719095755.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:12:57[UTC], changelist=411255, host=PWDFM101.wdf.sap.corp)

SapIdeWebDynproCheckLayer 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:00[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)

SapMetamodelCommon 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:46[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)

SapMetamodelCore 7.0009.20060210160857.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:13:38[UTC], changelist=388995, host=PWDFM101.wdf.sap.corp)

SapMetamodelDictionary 7.0009.20060719095619.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:21:59[UTC], changelist=411251, host=PWDFM101.wdf.sap.corp)

SapMetamodelWebDynpro 7.0009.20060428190938.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:26:52[UTC], changelist=400815, host=PWDFM101.wdf.sap.corp)

SapWebDynproGenerationCTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)

SapWebDynproGenerationCore 7.0009.20060802115035.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:30:11[UTC], changelist=413124, host=PWDFM101.wdf.sap.corp)

SapWebDynproGenerationTemplates 7.0009.20060804145649.0000 (release=645_VAL_REL, buildtime=2006-08-26:14:45:29[UTC], changelist=413534, host=pwdfm101)

sap.com/tcwddispwda

No information available null

sap.com/tcwdcorecomp

No information available null

Detailed Error Information

Detailed Exception Chain

java.lang.NullPointerException

at hbs.saf.TreeTut1View.wdDoModifyView(TreeTut1View.java:234)

at hbs.saf.wdp.InternalTreeTut1View.wdDoModifyView(InternalTreeTut1View.java:220)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)

at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:308)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:480)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:330)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:297)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:706)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:660)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:228)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:56)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:40)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

former_member365727
Active Contributor
0 Kudos

Hi Safeer,

Have u kept the code in if(firstTime).....

Regards

Srikanth

0 Kudos

Ya

if ( firstTime )

{

IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNode");

treeNode.mappingOfOnAction().addSourceMapping("path","selectedElement");

}

Former Member
0 Kudos

If treeNode is null, you probably used a wrong identifier in getElement(). Note that view element IDs are case-sensitive.

Armin