Add an Item to the New Action 在新建按钮中增加一个条目

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.

在本课中,您将学习如何在新建按钮(NewObjectViewController.NewObjectAction)中增加一个新的条目。将使用业务类库中Event类型。

Note 注意

Before proceeding, take a moment to review the following lessons.
在继续之前,请花点时间复习以下课程。

  • Place an Action in a Different Location
  • Add a Class from the Business Class Library and Use the Scheduler Module (XPO/EF)
  • 将操作放置在其他位置
  • 从商务舱库中添加类并使用计划程序模块 (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.

新操作的项在应用程序模型中由 CreatableItems 节点的子节点定义。因此,要将项添加到"新建操作"中,必须将子项添加到 CreatableItems 节点。默认情况下,其声明由 CreatableItem 属性或默认类选项属性修饰的业务对象可以通过任何视图中的"新操作"创建。但是,事件类(在从 Business 类库 (XPO) 主题添加类中添加)没有应用这些属性。此类在商务舱库中声明。尽管可以修改库源并重新编译库,但在应用程序模型中进行自定义更为方便。

  • 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.
  • 通过双击"模型.设计Diffs.xafml"文件来调用模型编辑器。在树视图中,导航到可创建项节点。如果展开此节点,您将看到与应用程序中使用的业务类对应的项。生成这些项目是因为 DefaultClassOptions 属性应用于相应的类。要添加其他项目,请右键单击可创建项节点,然后选择"添加..."可克雷项。

  • For the newly created node, select "Event" in the ModelClass dropdown list. The Caption property will automatically be set to "Scheduler Event".
  • 对于新创建的节点,在"模型类"下拉列表中选择"事件"。"标题"属性将自动设置为"计划程序事件"。。

  • 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.
  • 运行 WinForms 或ASP.NET应用程序。请注意,计划程序事件项已添加到"新操作"的下拉列表中。当另一种类型的对象显示在列表视图中时,此项允许您创建事件对象。另请注意,图像已分配给此项目。

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/

您可以在本课中为模型调用的模型编辑器中所做的更改。主演示模块项目。主演示应用程序安装在%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/

.

原文地址:https://www.cnblogs.com/foreachlife/p/Add-an-Item-to-the-New-Action.html

时间: 2024-07-29 10:52:17

Add an Item to the New Action 在新建按钮中增加一个条目的相关文章

struts2 从一个action跳转到另一个action的struts.xml文件的配置

解释: 想要用<result>跳转到另一个action,原来的配置代码是: <action name="insertDept" class="struts.org.db.DeptAction" method="insertDept"> <result name="success" type="redirect-action">selectDept</result&g

Effective C++ Item 09-绝不在构造函数和析构函数中调用virtual函数

Item 09-绝不在构造函数和析构函数中调用virtual函数(Never call virtual functions during construction or destruction) Why? 由于base class构造函数的执行更早于derived class构造函数,当base class构造函数执行derived class的成员变量尚未初始化.如果期间调用的virtual函数下降至derived class阶层,要知道derived class的函数几乎必然取用local成

在struts2的Action、Service中慎起get打头的方法

由于之前合并了流程及表单分类,在高级查询和流程管理页面打开z-tree树时,前端页面报出queryAllCategory()的空指针异常(逐步调试后在该方法中无空指针异常),并报如下错误: [16/06/14 07:30:07:007 CST] DEBUG sql.Connection: xxx Connection Closed org.codehaus.jackson.map.JsonMappingException: No serializer found for class org.ap

Effective C++ Item 12-复制对象时忽忘其每一个成分

Item 12-复制对象时忽忘其每一个成分(Copy all parts of an object) 设计良好之面向对象系统(OO-system)会将对象的内部封装起来,只留两个函数负责将对象拷贝(复制),那便是带着适切名称的copy构造函数和copy assignment操作符,称它们为copying函数. 如果是"编译器生成版本"的行为:将被拷对象的所有成员变量都做一份拷贝. 如果是自己声明就要注意了. 如果是为"derived class撰写copying函数"

listview当选中某一个item时设置背景色其他的不变

listview当选中某一个item时设置背景色其他的不变: 可以使用listview.setOnFoucsChangeListener(listener) ; /** * listview获得焦点和失去焦点时背景颜色的变化 * @author long * */ private class MyOnFocusChangeListener implements OnFocusChangeListener{ @Override public void onFocusChange(View v, b

判断最后listView中最后一个item是否完全显示出来

/** * 判断最后listView中最后一个item是否完全显示出来 * listView 是集合的那个ListView * @return true完全显示出来,否则false */ protected boolean isLastItemVisible() { final Adapter adapter1 = listView.getAdapter(); if (null == adapter || adapter.isEmpty()) { return true; } final int

XML From Action Script[AS中的XML学习笔记]

XML From Action Script XML 是 eXtensible Markup Language (可扩展标记语言)的缩写. E4X ECMAScript for XML 规范定义了一组用于处理 XML 数据的类和功能.这些类和功能统称为 E4X. ActionScript 3.0 包含 以下 E4X 类:XML. XMLList. QName 和 Namespace. E4X 包含了一些直观运算符(如点 (.) 和属性标识符 (@) 运算符),用于访问 XML 中的属性 (pro

struts2中的session、request 、和action往页面中传值的方法

ActionContext.getContext().put("list", list); ActionContext.getContext().getValueStack().push(listName);//准备回显数据 session中放数据: ActionContext.getContext().getSession().put("user", user); /** 注销 */ public String logout() throws Exception

Struts2 -- action的3中创建方式

1.创建一个POJO类. 单的Java对象(Plain Old Java Objects)           指的是没有实现任何接口,没有继承任何父类(除了Object) 优点:无耦合. 缺点:功能需要自己实现. public class Demo01Action { public String execute(){ return "success"; } } 2.创建一个类,实现Action接口.  com.opensymphony.xwork2.Action 优点:耦合低.提供了