Entering content frame

Procedure documentation Using the UI Element FunctionKey Locate the document in its SAP Library structure

Use

The FunctionKey UI element allows you trigger a Web Dynpro action using a specific key of the mobile device. In the following example, this UI element is used to navigate to another view via a specific key.

Prerequisites

·        The SAP NetWeaver Developer Studio is installed on your computer, you can use it to create your mobile Web Dynpro application

·        You must have access to a J2EE Engine on which you deploy the Web Dynpro application

·        You are using a pocket PC with special scanning equipment manufactured by Intermec Technologies or Symbol Technologies

·        You have created two views in a Web Dynpro project and called them, for example, StartingView and TargetView.

Procedure

Defining a View

...

       1.      Navigate to the desired starting view (called StartingView, for example).

       2.      Double-click the view to start editing or choose Edit from the context menu.

       3.      Insert the mobile UI element FunctionKey.

Defining Plugs and Setting Navigation Links

       4.      Switch to the Plugs tab.

       5.      Create an outbound plug with the name fromFunctionKey and define the navigation link to the TargetView.

Defining an Action

...

       1.      Switch to the Actions tab page.

       2.      Define an action, for example NavigateToAnotherView.

Specifying UI Element Properties

...

...

       1.      Assign the value IBrowse_OnKey49 to the keyCode property of the UI element FunctionKey.

       2.      Assign the action – in this case, NavigateToAnotherView – to the onAction property of the UI element NavigateToAnotherView.

Implementation of the View Controller

...

       1.      Add the following source code to the implementation of the view controller.

       2.      To do so, switch to the Implementation tab.
The read data is passed to the context and the relevant context attribute is set.

public void onActionNavigateToAnotherView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

  {

    //@@begin onActionNavigateToAnotherView(ServerEvent)

    wdThis.wdFirePlugFromFunctionKey();

    //@@end

  }

 

Result

If you press key 1 on the mobile device, you navigate to another view (in this example, to the TargetView).

  

  

 

Leaving content frame