Chinaunix首页 | 论坛 | 博客
  • 博客访问: 691037
  • 博文数量: 145
  • 博客积分: 3446
  • 博客等级: 中校
  • 技术积分: 1567
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-30 13:58
文章分类

全部博文(145)

文章存档

2021年(1)

2020年(1)

2019年(1)

2018年(6)

2017年(1)

2016年(10)

2015年(12)

2014年(10)

2013年(15)

2012年(33)

2011年(21)

2010年(9)

2009年(18)

2008年(2)

2006年(5)

我的朋友

分类:

2011-04-22 17:05:42

view controller也有自己的两个方法:
wddobeforeaction():
After the web dynpro application has been started and the user has raised a client event, the first methods to be processed in the wda are the wddobeforeaction() methods of all view controllers of the previous rendered view assembly, before the action handler method to the event processed.
webdomodifyview():
用于动态修改UI Element。
对于各类controller,用户都可以创建自己的methods。在创建method时,有三种类型可选:method, event handler和supply function。双击方法名就可以打开一个编辑器,书写实现代码。在一个component内,一个controller可以调用其他controller的方法,只要在这个controller内声明使用了另一个controller即可。如果要让一个controller的自定义方法能被位于component内的另外一个controller调用,那么需要设置该方法的Interface属性。
前面提到了controller的methods,现在轮到controller的attributes。除了interface controller和interface view controller外每个controller都有两个预定义好的attribute:WD_THIS和WD_CONTEXT。WD_THIS指向当前的controller interface, IF_;WD_CONTEXT指向controller context下的root node。访问context内的其他node/attribute就是借助它来完成的。
如果一个controller声明使用component controller,那么一个标准attribute WD_COMP_CONTROLLER会被自动创建,以指向component controller,这样component controller内的methods和public attributes就能被调用,wd_comp-controller -> method name 。
如果一个controller A声明使用其他类型的controller B(不是component controller),这时在controller A中不会自动生成一个指向controller B的引用。为了得到指向B的引用需要下面的办法:
DATA: lo_ctrl TYPE REF TO ig_.
lo_ctrl = wd_this->get__ctrl( ).
用户也可以自定义attribute。如果attribute的public flag被设置,那么这个attribute对于同一个component内的其他controller也是可见的。访问其他controller的public attribute的方式与访问method一样。
访问一个context node
对于每一个controller,系统都会为其自动创建一个interface,名为IF_。在这个interface中,对于每一个context node都会有一个相应的WDCTX_存在。访问root node直接使用WD_CONTEXT,访问root node的子node使用get_child_node( )方法,要注意的是方法名作为参数被传递时必须是大写!方法返回指向指定node的引用,类型为IF_WD_CONTEXT_NODE。这个方法还有一个可选参数,是要访问的element在父node中的索引编号。
 
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/chfeijj/archive/2009/12/29/5100163.aspx
阅读(1033) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~