Adding Custom Controls to Mobile Applications for Handhelds 
You add the custom control to the required View in the UI component to use the nonstandard UI functions of the custom control.
All custom controls are represented using the Interactive Form control. The Interactive Form control is added as a placeholder in the view. You can include the common properties of the custom control and native control in the Properties View. All properties that are specific to a custom control are coded in the view of the UI component.
You have created and packaged one or more custom controls.
More information:
In the Mobile Applications for Handhelds perspective, navigate to the Handhelds UI Explorer tab page.
Under , double-click the required view to open the view editor.
Select the Interactive Form control.
Edit the properties of the control in the Properties tab page.
Navigate to the Java perspective.
Create a custom_control.properties file and place it in the src/packages folder in the UI component.
Specify the key values in the custom_control.properties file.
Assign the factory class for the Wdlite-custom-control-factory-class-1 key.
Assign the custom control ID for the Wdlite-custom-control-factory-ids-1 key.
Example
There are two keys listed in the custom_control.properties file:
Wdlite-custom-control-factory-class-1=com.sap.SampleFlatButtonCustomWidgetFactory
The SampleFlatButtonCustomWidgetFactory implements IUIElementFactory interface.
Wdlite-custom-control-factory-ids-1=FlatButton
This key lists the ID of the custom control. If there are multiple custom controls, these are separated by commas.
In the Mobile Applications for Handhelds perspective, navigate to the Handhelds UI Explorer tab page.
In the Java Editor of the view, add the nonstandard properties of the custom control in the wdDoModifyView(App1ViewView view, boolean firstTime) method.
Example
public void wdDoModifyView(CustomappCompViewView view, boolean firstTime)
{ //@@begin wdDoModifyView()
// Gets the UI control based on the ID given in the custom_control.properties
view.getInteractiveFormViewItem().setUIControlSubType("Test");
//Setting the text property of the button
view.getInteractiveFormViewItem().setPropertyValue("text", "custom button");
//@@end }
Write the event handling code for the custom control.
Example
/**
* Event handler [onActionOnclick]
*/ public void onActionOnclick (Event wdEvent) {
//@@begin onActionOnclick(ServerEvent)
if(wdEvent.getEventData("EventData").toString()=="CreateEmployee") {
//Write code for the Onclick event
}
//@@end
}
Build and deploy the UI component.