Web Dynpor 组件属性介绍

来源:互联网 发布:餐饮排队叫号软件 编辑:程序博客网 时间:2024/06/11 10:13
Controller(控制器)

web dynpro component的controller分为四类:

component controller:这种类型的controller在一个web dynprocomponent内只存在一个,并且没有visual interface。

custom controller:这类controller是可选的,用于封装componentcontroller的sub-function。

View controller:每一个view都有一个对应的viewcontroller,负责与视图有关的逻辑,如检查用户的输入和处理user action。

Window controller:一个window内只存在一个windowcontroller,用于通过inbound plugs传递数据。

注意:Web dynpro 中有两个常提到的概念是context mapping和data binding。每个controller内部都会有一个context,用于存储controller所用的数据。 

Context 上下文属性
  • Context所持有的数据仅针对controllerlifecycle而存在。几个attributes可以组成一个结构叫做"Node",其功能就像是数据库中的一张表。
Cardinality
  • 基数(cardinality)属性:
  • cardinality:这个属性给出了当前node collection在运行时(runtime)包含的元素数目的最小值和最大值。
  • 这个属性的取值包括0..1(仅允许0或1个元素),0..n(允许0或更多元素),1..1(仅允许一个元素),1..n(允许一个或多个元素)。
Thefollowing values are possible:
  • 1..1 : The node contains exactly one instance that must always be instantiated
  • 0..1 : The node contains exactly one instance that does not have to be instantiated
  • 1..n : The node can contain multiple instances and at least one of them must be instantiated
  • 0..n : The node can contain multiple instances and none of them must be instantiated

注意:Thedefault is 1..1.

Selection

singleton:这个属性决定了子节点在实例化时是singleton还是不是singleton,因此它的值就是布尔值。在课程中在讲singleton时还提到了supply function,两者常在一起使用以实现lazy data instantiation。比如在加载一个包含多行的表时,每一行包含的更详细数据不会被首先加载,而只有在用户选中并查特定行时,与该行相关的数据在会被读取。

  Thefollowing values are possible:

  1..1: Exactly one instance (table row) must be selected. It is automatically thelead selection.

  0..1: No more than one instance (table row) can be selected. It is automaticallythe lead selection.

  1..n: Any number of instances can be selected, but at least one must be selected.One of them is the lead selection.

  0..n: Any number of instances can be selected, but none must be selected. One ofthe selected ones is the lead selection.

  注意:Thedefault is 0..1.