Show TOC Start of Content Area

Procedure documentation Applying the Component Controller Template  Locate the document in its SAP Library structure

Use

Mobile Applications for Handhelds provide a dedicated generation template to accelerate and simplify the UI development process in the Composite Development Scenario. When applied to a component controller, the template automatically creates:

      A Web Dynpro (WD) model of type Mobile Service Component Model

In this tutorial, the model is orderModel.

      The controller context with a structure that is identical to the referenced Mobile Service Component’s service operations, that is getOrdersByLongTextand generateTestData

The context nodes are bound to the respective WD model classes. Input and output structures of the service operations appear as context attributes.

      Supply functions that perform the model binding between the WD model and controller context

      Convenience methods within the controller that have the same name as the service operations

The controller methods getOrdersByLongText() and generateTestData can be directly called from the UI (thus binding the search button to the query) or within the custom coding (like calling the generateTestData() during Web Dynpro initialization onDoInit()).

You, as the application developer, subsequently own all generated code and model entities and can change these whenever required. In the example, you add custom coding in the wdDoInit.

Prerequisites

You have created a:

      Mobile Service Component order_srv with at least one service operation

      Mobile UI Component mobile_ui that has a dependency to the Mobile Service Component

      WD component

Procedure

1. Apply the Template

...

       1.      In the Handhelds UI Explorer, open the Component Controller context menu and choose Template Apply.

       2.      In the Apply Template dialog box, choose the Mobile Service Component template.

       3.      In the next dialog box, choose to create new Web Dynpro model orderModel.

       4.      In the Select Service dialog box, choose service orderService.

       5.      In the Select Entities dialog box, select service operations getOrdersByLongtextand generateTestData.

2. Adapt the Generated Code

...

       1.      In the Handhelds UI Explorer, open the component controller context menu and choose Open Java Editor.

       2.      Scroll to method wdDoInit().

       3.      In the Java Editor, scroll to the implementation of wdDoInit() and enter the following code between the //@@begin implementation and //@@end tags:

//@@begin implementation

    this.generateTestData();

//@@end

Result

The component controller context, model (if requested), supply functions, and convenience methods are generated and custom code is added in the specified location.

...

...

 

End of Content Area