cancel
Showing results for 
Search instead for 
Did you mean: 

Node supply function

Former Member
0 Kudos

Hi,

When does a node supply function get called?

I have a file download view where I have created this context node and provided it with a supply function to fetch the file data. The file name is obtained from the lead selection of a table.....so this supply functions needs to be called everytime a different file is selected.

So I tried "invalidate"ing the file data node on lead selection so that the supply function is triggered, but still it doesn't happen. What could be the problem

Accepted Solutions (0)

Answers (2)

Answers (2)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nirav,

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.+

Regards, Bertram

Former Member
0 Kudos

Hi Nirav,

the supply function is called, when the view is displayed to which the context is bound. I suppose there is something wrong with the 'invalidate'. Question: how do you access the context to be invalidated of the file download view ?

regards, Ulli

Former Member
0 Kudos

Hi Ulli,

Although I can avoid using the supply function, just for understanding, how do I make it trigger again. The actual scenerio is that this is a simple view with a file download element which is in a separate window. I create this window instance the first time and reuse this instance other times.

When exactly does the supply function get called and how can I make it get called again.

Nirav.

thomas_chadzelek
Participant
0 Kudos

Hello,

in general, a node's supply function is called whenever that node's elements are accessed for the first time (after invalidate()).

To answer your question, one needs to know more about how your context looks like and how your UI elements bind to it. Because the supply function will only be called if context data is actually needed in the UI.

Best regards,

Thomas