Start of Content Area

Procedure documentation Event Handling: Selecting an Entry Locate the document in its SAP Library structure

 

When a file in the tree is selected, you want its name to be displayed in the input field. To make this possible, you have created the attribute ignoreAction in the context, to which the parameter ignoreAction of the tree node is bound. This parameter decides whether the event onAction is triggered or not when a node is selected. You have set this attribute so that it is always true when a folder is displayed and false when a file is displayed. (see step: Initialising the Context)

You have also defined the action Select, which contains the selected node as a parameter. To fill this parameter with the correct value at runtime, you have executed a parameter mapping.

In this step, you now transfer the name of the selected element to the textOfSelectedNode context attribute to display the file name in the input field.

 

Procedure

...

       1.      To open the TreeView, double-click TreeView in the project structure in the Web Dynpro Explorer.

       2.      Choose the Implementation tab page.

       3.      Enter the following lines in the method onActionSelect():

public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tut.wd.tree.wdp.IPrivateTreeView .IFolderContentElement selectedElement )

  {

    //@@begin onActionSelect(ServerEvent)

    wdContext.currentContextElement().setTextOfSelectedNode(

         selectedElement.getText());

    //@@end

  }

 

Result

You have added all the necessary lines in the method onActionSelect(..) to display the name of a selected file in the input field.

Next step:

Building, Deploying, and Running the Project

 

 

End of Content Area