on 10-06-2008 6:36 AM
HI
What is Supply Function ?
Where we can use it .Can any one please Explain ?
Thanks
Kirankumar
Hi Kiran,
the NetWeaver Help contains the following details about Web Dynpro Supply Functions (under Web Dynpro - Advanced Web Dynpro Technologies - Context Description - Nodes and Node Elements - Supply Functions):
Invalid Context Nodes and Validation by Supply Functions
A supply function is called by the Web Dynpro runtime environment if node elements of an invalid context node are accessed. The Web Dynpro runtime environment executes a node validation.
Context nodes are set to invalid status under the following conditions:
· Initialization: Contexts are initialized by the Web Dynpro runtime environment as required. This means they only contain empty object instances.
· Changing the lead selection in the parent node: If the lead selection of the parent node changes, child nodes of type Singleton are invalidated by the Web Dynpro runtime environment.
· Invalidation using controller coding: The application developer can place context nodes into an invalid state directly using interface method IWDNode.invalidate(). The invalidation for child nodes takes place implicitly after the invalidation of parent nodes.
A context node is validated by the Web Dynpro runtime environment according to the following sequence of steps. If a condition is fulfilled, the check is terminated:
· The node is already valid: nothing happens.
· A supply function was defined for the node: the supply function is called
· Cardinality of the node is 1..1 or 1..n: a node element is added.
· An empty list of node elements is added.
As an application developer you can also force the validation of a context node using method IWDNode.validate().
Access to a context node requires its validation. The following forms of access are available:
· Data binding: UI elements are bound to context elements in context nodes and have to be supplied with data by the Web Dynpro runtime environment. Context nodes are validated for this by the Web Dynpro runtime environment.
· API access: The application developer access node elements using interface methods such as getCurrentElement(), getElementAt(index). If these node elements are located in invalid context nodes, they are validated before the actual method call
Thanks
Anup
Edited by: Anup Bharti on Oct 6, 2008 7:40 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
please go through this link
http://www.apentia-online.com/UP/Apentia/files/Article/inside_web_dynpro_for_java.pdf
Regards
Ruturaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
I had just answer your thread regarding Singleton. So you can use supply function to populate the data into Singleton Childnode. For example if CustomerDetails is parent node and Orderslist is child node.
CustomerDetails
CustomerNo CustomerName Address
-
-
-
OrderList
CustomerNo OrderId Orderdetails
-
-
-
Say these are two tables in your example where Orderlist is Singleton Child Node, then for every leadselection change in CustomerDetails parent list, the values in Child Orderlist table will be changed (only one instance for each element) that is populated by parent node.
Also go through the following link.
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d599690-0201-0010-12bb-b9ea3ea32d22]
Revert me if you have any doubts
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi!
in simple terms Supply functions are the mechanism to repopulate child nodes when the lead selection in the parent node changes. When a singleton child node is declared, you must also write an accompanying supply function.
The Web Dynpro Framework will then automatically call your supply function when the lead selection in the parent node changes.
you can use supply function primarily topopulate a singleton nodeu2019s element collection.However if required, any context node
can have a supply function defined for it.
thanks
vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
A supply function is called by the Web Dynpro runtime environment if node elements of an
invalid context node are accessed. The Web Dynpro runtime environment executes a node
validation.
Supply functions are used in particular to fill dependent context nodes of type Singleton-true,
automatically.
refer these links
http://help.sap.com/saphelp_nw04/helpdata/en/86/7fcf3d4f902d10e10000000a114084/frameset.htm
Regards
Sreedhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
Supply function principles:
- A supply function is used to populate an entire node collection.
- Any context node may have a supply function defined for it.
- All singleton nodes must have a supply function defined.
- The existence of a supply function is defined declaratively.
- A supply function is called automatically by the Web Dynpro Runtime when an attempt is made to read an empty node collection
- A node collection could be empty node collection
- A node collection could be empty for any one of the following 3 reasons.
1. It has never been populated before.
2. The lead selection in the parent node collection has changed.
3. Application coding has explicitly invalidated the element collection.
Why are supply function needed?
- A supply is needed primarily to populate a singleton node's element collection.
- However if required, any context node can have a supply function defined for it.
Web Dynpro programming model provides the concept of supply functions to fill context nodes (or more precisely u2013 their node collections). They can be defined for all value nodes (both dependent as well as independent ones), by assigning a method name to the node property supplyFunction in a controller context at design time. The Web Dynpro tools also automatically enhance the corresponding controller class with a supply function including the user coding area contained in it
Basically, we used these functions for calculations of different things using the model attributes and assign them to the required UI elements.
See the below link for details:
http://help.sap.com/erp2005_ehp_03/helpdata/EN/03/96384162316532e10000000a1550b0/frameset.htm
http://help.sap.com/erp2005_ehp_03/helpdata/EN/d6/078aa26b73fb47b43d9330f1a207cf/frameset.htm
points if useful.
thanks
Suresh
Edited by: Suresh Mandalapu on Oct 6, 2008 7:45 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
this pdf helps you ,
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/supply%2bfunction%2bin%2bwebdynpro
Regards,
ramesh
Edited by: Ramesh Babu V on Oct 6, 2008 11:12 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.