Entering content frame

Procedure documentation Event Handling: Selecting an Entry

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 and bound it to the parameter ignoreAction of the tree node.

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 false when a folder is displayed and true when a file is displayed (see Implementation Step 5).)

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.ITreeNodeElement 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

 

 

Leaving content frame