cancel
Showing results for 
Search instead for 
Did you mean: 

Doubts on Invalidate() method.

Former Member
0 Kudos

Hi,guys:

My Component Controller has the structure as following :

<b>Contex</b>t

-


<b>_nodeInput</b> (Executable RFC)

-


nodeA

-


nodeB

-


...

-


<b>_nodeOutput</b>(the result)

-


nodeA

-


nodeB

-


...

-


<b>nodeFlightList</b>

-


Atrribute1

-


Atrribute2

-


Atrribute3

........

My View Controller has the same structure with the aboved .

I have a table UI with datasource of <b>nodeFlightList</b>

After I call the Bapi ,i excecute:

wdContext.nodeBapi_Flight_Getlist_Input().nodeOutput().invalidate(),That's work fine .

However ,i don't understand why i must call the invalidate() from <b>nodeOutput</b> instead of <b>nodeInput</b>? ,even call invalidate() from <b>nodeFlightList</b> because the table UI just map nodeFlightList node ( the data of what i want to display all lie in this node(<b>nodeFlightList</b>))?

I have tried this two :

wdContext.<b>nodeBapi_Flight_Getlist_Input.invalidate()</b>

wdContext.nodeBapi_Flight_Getlist_Input().nodeOutput().<b>nodeFlightList().invalidate()</b>

No data was displayed in the table UI, they don't work .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Guixin,

Regardless of how the content of a node collection was determined, a node can be invalidated at any time which means that the value is redetermined the next time it is accessed.

Invalidation like this (i.e the root RFC node)

wdContext.nodeBapi_Flight_Getlist_Input.invalidate() 

will clear off everything from within the node.

For a better understanding, refer <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/66/8b3c413b456e24e10000000a155106/content.htm">Invalidating context node</a>

Warm regards,

Bala

Former Member
0 Kudos

Bala :

I think Invalidat() not only conduct "clear off everything from within the node" , but more importantly ,it synchroniz data in context with Mode. right ? I don't think you clearify my doubts .

former_member85655
Active Participant
0 Kudos

With Invalidate() the data gets cleared off and later during any first access, fresh data is again loaded from a supply function.So the supply function then again acts as a data supplier.

Regards,

Arun

Former Member
0 Kudos

Arun :

In my case , no any node in context has <b>supply function</b>.

Former Member
0 Kudos

Guixin,

First and foremost invalidate() destroys context of node. But interesting things happen next

In WD you may have nodes with or without automatically supplied context.

First type has 2 variation

-- model / value nodes with supplyFunction defined. When this node is re-validating with either explicit call to validate() or access to node elements, then supply function is invoked to populate node.

-- model nodes with supplyingRelationRole defined. Check your context. Your nodes _Output and _List has this role defined. When this node is re-validating, model object from parent node element is queried for relation. Related items are used to populate node in question.

Second type is your _Input node. It has neither supplying relation (because it has no model "parent") nor supply function. So after destroying context with invalidate() it should be explicitly populated with either bind() or addElement(). No automatic validation here possible.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Answers (0)