important attributes in different controllers

[size=large]Controller Attributes[/size]
Each controller is a separate ABAP program,having not only predefined and user-defined methods,but also attributes,which are at least visible for each method of the controller.

[size=large]Standard Attributes[/size]
After having defined a controller,at least two attributes are predefined.These attributes have a visibility,which is restricted to the controller methods.The standard attributes are:

WD_THIS
WD_THIS is a self reference to the controller interface.This attribute must be distinguished from the standard ABAP self reference ME,which should not be used in the source code of any controller.WD_THIS is a reference to the current controller's interface,IF_<controller name>,and represents all the functionality implemented in the generated class.This also gives you access to standard Web Dynpro functionality,such as validation.

WD_CONTEXT
WD_CONTEXT is the reference to the controller's context root node,and thus to the entire context.Any access to the controller's context starts with this reference.

WD_CONTEXT and WD_THIS
a. Present in any Web Dynpro controller(except interface and interface view controller)
b.WD_THIS: Self reference of the local interface - type depends on the controller type.
c. WD_CONTEXT: Reference to the context of the associated controller.

If the Component controller is declared as a used controller on the Properties tab of any other controller,an addtitional attribute is automatically created for the controller that declared the usage:

[size=large]* WD_COMP_CONTROLLER[/size]
wd_comp_controller is the reference to the component controller.Using this reference, all methods and all public attributes of the component controller can be accessed(wd_comp_controller-><meth>,where <meth> is a placeholder for the methods name).
a.Reference to the component controller with access to all ordinary methods and public attributes
b. Attribute will be assigned if the component controller is defined as a used controller in the Properties tab of this controller.

*** For all other controllers,even if declared as used controllers,such a reference is not available.However this does not mean,that user-defined methods and public attributes are not available,but that the reference must be evalutated first.To have the reference to the <ctrl>controller defined as a used controller,the following statement must be used:
DATA: lo_ctrl type ref to ig_<ctrl>.
lo_ctrl = wd_this->get_<ctrl>_ctr().

[size=large]User-Defined Attributes[/size]
On the Attributes tab,additional attributes can be defined for the related controller.If the Public flag is set,these attributes are also visible for other controllers of the same Web Dynpro component.Attributes can not be exposed to the components interface.
In order to access public controller attributes in one of the controller's methods, the self-reference variable WD_THIS has to be used.Accessing public attributes defined in other controllers of the same component is implemented similarly to accessing methods defined in other controllers.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值