Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Controllers/Contexts
Types of Controllers
Three types of controller
View controller
Each view has exactly one view controller, which processes the actions performed by the user in the view
Window controller
Each window has exactly one window controller. It behaves like a view controller (plugs) and is usable from other controllers (like a custom / component controller)
Context Each controller has its own context. Root Node is already created Methods Called by Web Dynpro Framework(WDF). Processed Once during the life time of controller Instance
1.Standard hook methods when a controller instance is created wddoinit( ) when a controller instance is deleted wddoexit( ). 2.Additional methods can be defined using the Methods tab.
Attributes Attributes not related to the value or property of UI elements can be declared using the Attributes tab. visible in all methods of this controller. 1.Standard Attributes
Has to define for UI elements which trigger events e.g. Pushbutton, Radiobutton, Checkboxes etc,
Problem Develop a Web Dynpro application with more than one view. On views, provide buttons to allow the user to initiate navigation to the next view. Process Task 1:Create a Web Dynpro component with a Web Dynpro window and two Web Dynpro views. 1. Create Web Dynpro component(ZWD_CNTR_##) with a main window MAIN_WINDOW. 2. Create two Web Dynpro views (INPUT_VIEW and OUTPUT_VIEW) inside wd component and embed them into window.
Structure
Context Node:
Are arranged hierarchically and are permitted to have children Children of a node may be entities known as other nodes or attributes Metadata description declared manually or derived from a Dictionary Structure
Context Attribute:
Stores runtime data or references to runtime data Based on DDIC Types
Context Binding
Context Like a data container which holds the data The data transport between the UI Element and Context happens automatically by Binding
Label
Context Node: Properties collection The cardinality property controls the number of elements a node
may hold at runtime.
Cardinality of a Context Node 11 Only one element is instantiated. 01 At runtime, no more than one element is instantiated, but it is also possible that no element is instantiated. 1n n elements can be instantiated, but at least one element must be instantiated. 0n The number of instantiated elements of the context node can vary.
The Lead Selection Accessing/Marking of the Elements of node. Exactly One element from the collection of node element can be marked Setting The Lead Selection automatically by the Web Dynpro framework if the context node property Initialize Lead Selection is set to true. program source code. user actions related to UI elements (e.g. mark line in table view element, which is bound to the node). The Singleton Property Defines relationship between a dependent node and its parent node. Singleton Non-singleton
Non-Singleton For every element in the parent node collection there will be a distinct instance of the child node
Singleton Does not matter how many elements are present in the parent node there will only ever be one instance of the child node collection
Supply Function Characteristics: Is mechanism to repopulate child nodes controller method is generated for supply function can be assigned to each context node of a controller Very Useful For singleton nodes
Automatically called by Runtime When: The node collection is initial. The lead selection in the parent node collection is changed. The node collection is invalidated programmatically.
Context mapping is the primary mechanism for sharing data between different controllers. Advantages: Data is automatically available to all controllers using the mapping relationship
Context Mapping
Context Root
FLIGHTS BOOKINGS
Context Root
FLIGHTS
BOOKINGS
Controller Usage Declaration BOOKID CUSTID CLASS PASSN CARRID CONNID FLDATE PRICE
BOOKID
CUSTID CLASS PASSN CARRID CONNID FLDATE PRICE
User Interface
UI Element Categories
User Interface
Arrangement of UI Elements
Container Elements and Layout Container elements are UI elements that may have child elements Managers their children will be arranged All container elements define with Layout property how
The Layout property may have four values: 1. FlowLayout 2. RowLayout 3 MatrixLayout 4.GridLayout Adding UI Elements to the Layout Controlling UI Element Properties
Reference to the context node should be created For each controller (<ctrl>), an interface is generated having the name IF_<ctrl>. For each node <node> of a controller context, a constant (WDCTX_<node>) is generated in this interface;
Thank You