Add an Item to the New Action to add an entry in the New button

In this lesson, you will learn how to add an item to the New Action (NewObjectViewController.NewObjectAction). The Event business class from the Business Class Library will be used.

In this lesson, you will learn how to add a new entry in the New button (NewObjectViewController.NewObjectAction) in. The use of business class library Event type.

Note Note

Before proceeding, take a moment to review
the following lessons. Before proceeding, please take a moment to review the following courses.

  • Place an Action in a Different Location
  • Add a Class from the Business Class Library and Use the Scheduler Module (XPO/EF)
  • The operation in other locations
  • Add Class from Business Class library and use the Scheduler module (XPO / EF)

 

The New Action's items are defined in the Application Model by child nodes of the CreatableItems node. So, to add an item to the New Action, it is necessary to add a child to the CreatableItems node. By default, business objects whose declarations are decorated by the CreatableItemAttribute or DefaultClassOptionsAttribute can be created via the New Action from any View. However, the Event class (added in the Add a Class from the Business Class Library (XPO) topic) has none of these attributes applied. This class is declared in the Business Class Library. Although it is possible to modify the library sources and recompile the library, it is more convenient to make customizations in the Application Model.

The new entry node operation defined by CreatableItems child node in the application model. So, to add items to "New Action", you must add a child node to CreatableItems. By default, modify its declaration by CreatableItem class properties or default options attribute of the business objects can be created by any of the views of "new operation." However, the event class (added from Business library (XPO) theme add class) do not apply these attributes. Such statements are in business class library. Although you can modify and recompile the source database library, but more convenient to customize the application model.

 

  • Invoke the Model Editor by double-clicking the Model.DesignedDiffs.xafml file from the MySolution.Module project. In the tree view, navigate to the CreatableItems node. If you expand this node, you will see the items that correspond to the business classes used in your application. These items were generated because the DefaultClassOptions attribute is applied to the corresponding classes. To add another item, right-click the CreatableItems node, and choose Add... | CreatableItem.

  • By double-clicking "model. Design Diffs.xafml" file to invoke Model Editor. In the tree view, navigate to the item node can be created. If you expand this node, you will see the items of business class and used in the application of the corresponding. These items are generated because DefaultClassOptions attribute applied to the respective classes. To add other items, please right-click to create an item node, and select "Add ..." to Clay items.

    Tutorial_UIC_Lesson13_1

  • For the newly created node, select "Event" in the ModelClass dropdown list. The Caption property will automatically be set to "Scheduler Event".

  • For the newly created node, select the "Events" in the "Model type" drop-down list. "Title" attribute is automatically set to "event scheduler." .

    Tutorial_UIC_Lesson13_2

  • Run the WinForms or ASP.NET application. Notice that the Scheduler Event item has been added to the New Action's dropdown list. This item allows you to create Event objects, when objects of another type are displayed in the List View. Also note that an image has already been assigned to this item.

  • Run WinForms or ASP.NET applications. Please note that the Scheduler event items have been added to the "new operation" drop-down list. When another type of objects displayed in the list view, this allows you to create an event object. Also note that the image has been assigned to this project.

    Tutorial_UIC_Lesson13_3

You can see the changes made in this lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

Change the model editor you can model calls you made in this lesson. The main demonstration module project. The demo application is installed in the main % the PUBLIC% \ Documents \ DevExpress the Demos 19.2 \ Components \ eXpressApp Framework \ MainDemo by default. The Available Online at The ASP.NET Version IS AT http://demos.devexpress.com/XAF/MainDemo/

.

Guess you like

Origin www.cnblogs.com/foreachlife/p/Add-an-Item-to-the-New-Action.html