您的位置:首页 > 其它

web dynpro for abap 基础知识(二)

2009-12-29 17:38 239 查看
有些UI elements是不可见的,如TransparentContainer, ViewUIElementsContainer。这类元素用于组织其他的可见元素,如Button, Label,InputField,Table,Tree等。

所有的UI elements被组织成一个树状结构,根节点名为RootUIElement,类型为TransparentContainer。RootUIElement下的每个container element都有一个属性Layout,它

规定了在container内元素的布局。4种layout manager可供layout属性选择:

FlowLayout
Rowlayout
MatrixLayout
GridLayout

如果一个UI element被绑定到了一个context内的node或attribute,那么这个node/attribute的值就会被赋给这个UI element。当UI element的值发生变化时,这种变化也会

自动反映到context中的node/attribute上。这就是前面已经提及的data binding。这种绑定只能发生在同一个view的context和view controller之间。当想改变一个UI

element的行为时,只需修改与这个UI element绑定的node/attribute。

UI elements如TextView,Label,Caption被用于显示文字。当这类UI elements被绑定到attribute,而attribute是与data dictionary中data element有关。这时这个data

element的相应文字会被用于这个UI element。另一种情况是,a Label is related to a InputField, and the Text property of the Label is left blank. The label

text then originates from the data element related to the InputField.

Composite UI Elements

有的UI element由多个基本的UI elements组成,如Table(由多个TableColumn构成)。每个TableColumn又由一个Caption和一个Cell editor(默认为TextView这种类型的UI

)组成。Table这类UI element只能被绑定到cardinality为0..n或1..n的node。每个Table有一个属性selectionMode,有6个不同的值来控制行的选择,具体参见文档第86 -

87页。

在web dynpro中每个controller都有两个默认的方法:

wddoinit():这是一个controller内第一个被调用的方法,常用于初始化数据。

wddoexit():这是一个controller内最后一个被调用的方法,用于做收尾工作。

这两个方法在controller被创建时自动生成,并且都是空的方法。

对于component controller还有两外两个重要的方法:

wddobeforenavigation():
This method is called after the action method has been processed and just before the web dynpro frameworkprocesses the events in the navigation queque.

wddopostprocessing():
This method allows data validation from multiple components, and it's the last controller method that is processed before the UI is sent to the client.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: