Building Mobile Enterprise Applications : webMethods Mobile Development Help : Building the User Interface for a Mobile Application : Using Templates to Define Custom Objects for a Mobile Project : Creating a Template for a Custom Object
Creating a Template for a Custom Object
Create a template if you want to customize a user interface object for your Mobile Project.
To create a template
1. Ensure the Mobile Project to which you want to add a template is open in the Outline Editor. For instructions, see Displaying a Mobile Project in the Outline Editor.
2. In the Model section of the Outline Editor, expand the outline so that you view the UserInterface > Templates node.
3. Right-click the Templates node and select New Child > Template.
Mobile Development adds a Template child node.
4. Select the new Template node.
5. In the Properties section of the Outline Editor, specify a Java class name in the Class Name property.
For example, if you want to customize the Button user interface object, you might specify MyButtonTemplate.
Mobile Development renames the Template node to the name you specified in the Class Name property.
6. Right-click the template node you just added and select New Child > object, where object is the type of object you want to customize.
For example, if you want to customize the Button object, select New Child > Button.
7. Select the new node you added and in the Properties section of the Outline Editor, fill in the properties. For more information about properties, see Template Properties.
8. Save the Mobile Project and generate sources for the Mobile Project. For more information, see Generating Sources for a Mobile Project.
Mobile Development generates the following Java classes for the template:
*Abstracttemplate_name.java in the gen/src folder in thepackage_name.ui.templates package
This class contains the standard logic to handle the user interface object you are customizing with the template.
Important:  
Do not update this Java class. Mobile Development regenerates it each time you generate sources and any changes you make will be overwritten.
*template_name.java in the src folder in the package_name.ui.templates package
You update the templat_name.java class to customize the user interface object.
For the generated Java classes:
*template_name is the Java class name you specified for the Class Name property of the template node.
*package_name is the package name you specified for your Mobile Project.
9. Add the logic to customize the user interface object to thetemplate_name.java class.
Copyright © 2007-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback