Logic for a Method Name Property
Several user interface objects have a Method Name property where you can specify a method to invoke at run time. For example, you specify a method name for the DynamicDropDownListEntryItem object to identify the method the application executes at run time to populate the parent DropDownListEntry object.
If you specify a method in a Method Name property, when you generate sources, Mobile Development generates the method in the abstract controller for the associated view. Mobile Development generates the abstract controller, which is named Abstractview_nameController.java, in the gen/src folder in the package_name.ui package. For example, if you specify the Method Name property for a user interface object in the view named “MyView” and you assign the mobile project the package name “com.mycompany”, Mobile Development generates the method in AbstractMyViewController.java in the com.mycompany.ui package, which is in the gen/src folder.
To add the logic to the method, first you must add the method to the user space, that is, into the view_nameControllerImpl.java file in the package_name.ui.controller.impl package in the src folder. For example, continuing with the previous example, you add the method to MyViewControllerImpl.java in the com.mycompany.ui.controller.impl package, which is in the src folder. After adding the view to the user space, you can add your custom logic.
CAUTION:
Do not add your logic to Abstractview_nameController.java. When you generate sources, Mobile Development regenerates this class and your changes will be lost.
Related Topics