6 11 5 Create Applications Using a Wizard

Visual LANSA

6.11.5 Create Applications Using a Wizard

You can create LANSA applications modeled on the LANSA Editor using a simple wizard.

The generated application will have:

  • An interface capable of handling documents
  • A list of proxies (representing documents) in the object browser which the end-user can use to navigate through the list of documents.
  • An embedded document editor for viewing and editing documents.
  • A File menu with predefined common commands: New, Save, Close, Show Browser, Open Objects…

Here is an example of an application created with the wizard:

To run the wizard select Wizard in the Tools tab of the ribbon:

And then select the Visual LANSA CRUD Application:

The generated application consists of:

  • The main form which is the skeleton of your application. All objects including the ribbon and the menu reside on the main form.
  • The ribbon: the Show Browser and Open Objects commands are placed on ribbon by default. Show Browser shows the object browser and Open objects shows a list of last opened documents. You can add new commands to the ribbon. For each new command place a push button on the ribbon, assign an icon to it and write a click event for it.
  • The menu bar: The menu bar contains menu items for predefined common commands. You can add new menu items and base their code on any of the predefined commands:

  • The document: Document is a list of properties to be shown or edited as a whole. If you use the sample data option in the wizard (which is the default option) your document will have the properties of Name and Description. If you choose to use an existing file, the document will consist of all the fields of that file.
  • The proxy: Proxy is a subset of properties of each document which acts as a unique key for accessing that document. What you see in the Object Browser is a list of proxies. Because documents are worked on one at a time, there is no point in loading all documents at once. Only the proxies are loaded and when a proxy is selected, the document associated with it is loaded. In the standard example the proxy and the document have the same number of properties ("Name" and "Description"), but normally a document contains more data.
  • Object Browser: Object browser shows a list of all proxies.

You can see a list of the generated objects on the last page of the wizard (prefixed "MY_" prefix by default; you can change it):

  • MY_DATA: This class defines your data model class with the properties of your document. If you want to change document properties you can make changes here. The generated application uses this class for both proxy and document objects.
  • MY_STORE: This class contains a list of MY_DATA objects representing all documents. It has functionality to insert, delete and update a document or to find a document using its proxy.
  • MY_EDIT: This is a reusable part providing the visual representation of the document to edit.
  • MY_BRWSR: This is a class that handles the proxy list as described above using a tree view.
  • MY_MAIN: This is the main form of your application where the ribbon, menus and all other objects reside.  You can place new ribbon buttons or add new menu items in the code and start adding new features to your application.