`
loky
  • 浏览: 180968 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

WDA Introduction to controllers

阅读更多
Introduction:-
Controllers are the active parts of a Web Dynpro application. They define how the user can interact with the Web Dynpro application. The data that a controller can access is defined in the corresponding context. Different instances of controllers and contexts exist within a Web Dynpro application. Controllers contain the source code of a Web Dynpro application; they hold the context data and care for event handling and navigation. Any programming of flow logic requires the knowledge of how controllers are defined and what kind of entities they offer.
Controller Types
There are four types of controllers in an ABAP Web Dynpro component. These different controller types differ in the entities they are composed of:-
1.   Component controller:-
There is only one component controller per Web Dynpro component. This is a global controller, visible to all other controllers. The component controller drives the functionality of the entire component. This controller has no visual interface. The lifetime of the component controller equals the lifetime of the component. When starting a Web Dynpro application, the component controller is instantiated by the Web Dynpro runtime
2.   Custom controllers
Custom controllers are optional. They have to be defined at design time and can be used to encapsulate sub-functions of the component controller. Multiple custom controllers can be defined in a component. Custom controllers are instantiated automatically by the Web Dynpro framework and the instantiation order is undefined; therefore, the coding in a custom controller should make no assumptions about the existence of any other custom controller. The instantiation of a custom controller is delayed until the first method of the controller is called. Custom controller instances cannot be deleted explicitly.
3.   Configuration controller
This is a special custom controller. It is only necessary if the corresponding component implements special configuration and personalization functionality. Only one configuration controller may exist in any component. Any other controller can access the configuration controller, but the configuration controller cannot access any other controller. This controller is instantiated as the first controller of the component. It lives as long as the component lives.
4.   View controllers
Each view consists of the layout part and exactly one view controller. This controller cares for view-specific flow logic, like checking user input and handling user actions. The instantiation of a view controller is delayed until the first method of the controller is called. The lifetime of a view controller can be controlled by the views properties. If framework controlled is selected, the view instance will be deleted with the component. If when visible is selected, the view instance is deleted as soon as the view no longer belongs to the view assembly.
5.   Window controllers
Each window has exactly one window controller. This controller can be used to care for the data passed via the inbound plugs when being reused as a child controller. Methods of this controller can be called from the inbound plug methods of the window. The instantiation of a window controller is delayed until the first method of this controller is called. This is done by starting a Web Dynpro application or by embedding the related interface view in the parent component's window. Window controller instances cannot be deleted explicitly.
At runtime, all controller instances are singletons in respect to their parent component.
This is also true for view controllers; thus, embedding a view in a view assembly more than one time is not allowed. The global data of a controller is stored in hierarchical data storage, the controller context. This context and the methods defined in a controller are private unless another controller explicitly declares the usage of this controller. However, a view controller cannot be declared as a used controller, so the context data and the methods of a view controller are always private.
Common Controller Entities:-

Each controller has its own context. The context root node already exists. All other nodes and attributes have to be defined statically or by source code. For all controllers, there exist methods that are called by the Web Dynpro framework in a predefined order. These are called hook methods. Depending on the controller type, there are different hook methods available. At least two hook methods are contained in all controller types. These methods are processed only once during the lifetime of a controller instance: when a controller instance is created (wddoinit( )) and when a controller instance is deleted (wddoexit( )). Attributes not related to the value or property of UI elements can be declared using the Attributes tab. These attributes are then visible in all methods of this controller. There are two predefined attributes, which are used to access the functionality of the controller (WD_THIS) and of the context (WD_CONTEXT). For information to be shared between different controllers, one controller must declare the use of another controller. This is done on the Properties tab of the controller that needs to access another controller. The most frequent requirement for this kind of data sharing is when we wish to create a mapped context node or we wish to access another controller's instance methods. We may not specify the name of a view controller as a used controller, as this would violate good MVC design principles. A view controller should be written such that it is responsible for nothing more than the display of data and user interaction. A view controller is not responsible for generating the data it displays; that is the role of a custom controller. Business logic, such as function modules, BAPIs, or methods in helper classes can be accessed from the methods of all controllers.
Special Entities of Component/Custom Controllers:-
For both component and custom controllers, events can be defined with arbitrary parameters. Any method of any other controller (also view and window controllers) can register to these events if this method is defined as an event handler method. A typical use of such events is the invocation of processing in a view controller after processing in the component controller has been completed. This can be achieved when a method in the view controller subscribes to an event raised by the component controller. Using our design time declarations, the Web Dynpro framework will automatically manage the definition, triggering, and handler subscription to such events for us. If two or more methods subscribe to the same event, the order in which they will be executed is undefined. Only the component controller has additional standard hook methods. These are processed directly before the navigation requests are processed (wddobeforenavigation( )) and after all views of the view assembly to be sent have been processed (wddopostprocessing( )).Attributes, methods, context elements, and events can be marked as interface elements. These elements are then exposed to other components by means of the interface controller.
Special Entities of View Controllers:-
A view controller is a visual building block of a Web Dynpro component and is designed to handle all aspects of data display and user interaction. For navigation to take place between different Web Dynpro view controllers, special navigation events and navigation event handlers have been created. These are called navigation plugs. A navigation event is raised when an outbound plug is fired. Using the generic name <Outbound plug> for an outbound plug, its declaration will cause a method to be generated in the view's component controller, called FIRE<Outbound plug>PLG. This method is only visible for the Web Dynpro framework; it is not visible to the developer. An inbound plug is the navigation event handler that can be registered to a navigation request. Using the generic name <Inbound plug> for an inbound plug, its declaration will cause a method to be generated in the view's component controller, called
HANDLE<Inbound plug>.A static registration of an inbound plug (method HANDLE<Inbound plug>) to the navigation event raised by an outbound plug (method FIRE<Outbound plug>PLG) is called a navigation link. Navigation links are not part of a view but are defined in a window embedding the view. Thus, in different windows, the event registration can be defined differently. An action links a client-side event to an event handler method defined in the corresponding view controller. When defining an action having the name <Action>, an event handler method (ONACTION<Action>) is automatically generated. If a view will be replaced as a result of a client event, the related outbound plug can be fired in this action event handler method. There are two special hook methods found in view controller: wddobeforeaction( ) is processed if a client event is fired in any view. Before the action event handler methods are processed, thewddobeforeaction( )_methods are executed for all views that are part of the last view assembly: _wddomodifyview( ) is a method that allows us to programmatically manipulate the layout of the view. This event can be used to define the UI dynamically. In addition to the standard attributes of all controllers, a view controller has a reference to the component controller of its component: WD_COMP_CONTROLLER. This reference can be used to access functionality related to the component controller. It is used when accessing messages or when calling a method declared in the component controller.
Special Entities of Window Controllers:-
Window controllers are very similar to view controllers. Technically, it is like a view controller without a UI (view layout). All views that are to be displayed when using a Web application have to be embedded in the window that is referred to by the application or the calling component. The Web Dynpro window contains the structure of all views to be displayed and the navigation links defining the possible view assemblies. Each Web Dynpro window contains outbound plugs and inbound plugs, like views. We can use the plugs to set up cross-component navigation. To expose the plugs to the component interface, select the property Interface for each plug. These plugs will then be part of the related interface view. The window controller also has the special attribute WD_COMP_CONTROLLER, which holds the reference to the component controller.

http://wiki.sdn.sap.com/wiki/display/WDABAP/Introduction+to+controllers
分享到:
评论

相关推荐

    sap wda实例与讲解

    【SAP WDA详解】 SAP Web Dynpro for ABAP(简称WDA)是SAP提供的一个用于构建企业级Web应用程序的技术平台。WDA旨在简化用户界面开发,提供高效的业务流程交互,尤其适用于桌面和现代触摸设备。在这个实例与讲解中...

    WDA ALV程序创建显示自己做的记录步骤

    WDA ALV程序创建显示自己做的记录步骤 WDA(Web Dynpro ABAP)是一种基于ABAP语言的Web开发框架,ALV(Advanced List Viewer)是一种高级列表查看器,常用于数据展示和处理。下面将详细介绍WDA ALV程序创建显示自己...

    Web Dynpro系列 WDA Architecture

    Web Dynpro ABAP(WDA)是SAP开发的一种技术,用于构建企业级的富客户端应用程序。WDA全称是Web Dynpro Application,它提供了一种结构化的方法来设计、开发和维护复杂的用户界面。在WDA架构中,我们看到的是对传统...

    WDA Tutorial 02_ Using Select Options in a WDA Application

    在视图属性的“Used Controllers/Components”选项卡中,添加之前定义的两个Select_Options组件。 #### 2.4 定义属性 在视图中定义所需的属性。这通常包括控件的名称、类型以及其他配置参数。例如,可以定义一个...

    Window平台实现IOS自动化-WDA编译

    苹果手机自动化测试 资源 网盘下载 包含Vmware、macos、 xcode、 wda源码 适合小白 希望在window平台实现苹果手机控制 按照视频教程操作可以少走弯路 想在window平台通过虚拟机实现xcode学习、开发的菜鸟

    rocker 620wda驱动

    标题中的“rocker 620wda驱动”指的是针对Rocker 620WDA扩展卡的驱动程序。Rocker 620WDA可能是一款专为增强计算机硬件性能而设计的PCIe扩展卡,比如用于提升存储速度或者网络性能。在计算机硬件中,驱动程序是操作...

    wda BAPI的使用讲解

    ### SAP Web Dynpro (WDA) BAPI 使用详解 #### 一、引言 在SAP Web Dynpro(Web Dynpro for ABAP, 简称WDA)中,BAPI(Business API)是一种用于执行特定业务逻辑的功能模块。本文将详细介绍如何在SAP WDA中使用...

    PyPI 官网下载 | facebook-wda-1.0.1.tar.gz

    **PyPI 官网下载 | facebook-wda-1.0.1.tar.gz** PyPI(Python Package Index)是Python开发者最常使用的软件包仓库,它提供了丰富的Python库供用户下载和使用。`facebook-wda-1.0.1.tar.gz` 是一个在PyPI上发布的...

    PyPI 官网下载 | facebook-wda-0.0.2.dev11.tar.gz

    标题中的"PyPI 官网下载 | facebook-wda-0.0.2.dev11.tar.gz"表明这是一个从Python Package Index (PyPI)官方下载的软件包,名为`facebook-wda`,版本号为`0.0.2.dev11`,并且是以`.tar.gz`格式压缩的文件。...

    WDA for Practitioners.7z

    - **配置控制器(Controllers)**:控制器管理视图的逻辑,处理事件和数据流。 - **绑定模型(Models)**:模型是数据的容器,负责与后端系统的数据交互。 - **发布和部署**:完成开发后,应用程序需要发布到SAP ...

    基于Java的WDA文件在线预览系统设计源码

    本设计源码提供了一个基于Java的WDA文件在线预览系统。项目包含137个文件,主要使用Java编程语言,并包含了CSS、JavaScript和HTML。文件类型包括53个Java源代码文件、17个JAR包文件、15个PNG图片文件、13个JSP页面...

    SAP WDA 创建导航应用

    这是显示通过扩展教程网页Dynpro BAPI为ABAP用法与额外——为了要显示一个消息在此情况下,没有航班可供一个特定的出发点与目的地的组合。当然,你将能够重新回到寻找一个新的组合。

    SAP WDA 基本原理 NET310

    SAP WDA(Web Dynpro for ABAP)是SAP NetWeaver平台下的一个用于开发和维护Web应用程序的模型驱动开发工具。WDA是基于ABAP技术的应用程序设计方式,它允许开发者使用图形用户界面来构建和管理Web应用程序,而不必...

    淘宝tidevice启动WDA背后的秘密.pdf

    淘宝tidevice是阿里巴巴开源项目中的一个工具,主要用于启动WebDriverAgent(WDA)。它的出现解决了传统使用xcodebuild启动WDA时的一系列问题,如启动慢、环境配置复杂、只支持Mac平台运行、连接多个设备时的冲突,...

    WDA学习资料11111111

    WDA学习资料11111111

    IOS自动化wda打包

    在iOS自动化测试领域,WebDriverAgent(WDA)是一种广泛使用的工具,它基于Appium,并提供了对iOS设备的原生UI自动化支持。WDA允许开发者通过HTTP接口与设备进行交互,执行点击、滑动、输入文本等操作,进行功能测试...

    WDA学习笔记二.docx

    SAP Web Dynpro For ABAP 学习笔记二 本文档是关于使用 SAP Web Dynpro For ABAP 创建第一个 Web Dynpro 程序的学习笔记。以下是学习笔记的详细内容: 一、配置 SAP Developer Studio 在学习创建 Web Dynpro 程序...

    wda.zip_visual c

    【标题】"wda.zip_visual c" 是一个与Visual C++相关的压缩包,其中包含了一个小型的Win32程序,该程序能够实现对".txt"文本文件的打开和关闭操作。这个项目可能是一个简单的文本编辑器或者文件管理器的原型,用于...

    Python库 | facebook-wda-0.0.2.dev30.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:facebook-wda-0.0.2.dev30.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

Global site tag (gtag.js) - Google Analytics