cancel
Showing results for 
Search instead for 
Did you mean: 

Dispose functions

Former Member
0 Kudos

hi,

Has anybody worked with dispose functions??

Can anybody explain the workings of it with code

Accepted Solutions (0)

Answers (2)

Answers (2)

ThatSAPGuy
Advisor
Advisor
0 Kudos

Pinki-

I'll try and explain the Dispose Function through an example. Lets say you have a parent and a child node (eg. Sales Order and Sales Order Item). The relationship between them is Singleton and you have developed a Supply Function which populates the sales order item elements based upon the lead select in the sales order table. Assume here that the sales order item table has an editable field.

Now when an element in the sales order table is selected the Supply Function populates the sales order item table. Lets say you change the value of the editable field in the sales order item table and then change the lead select in the sales order table. When you bring the lead select back to the sales order you had originally selected you will notice that the changes you made to the sales order item have gone since the supply function has no idea that you had in fact changed it. This is where the Dispose Function comes in and works in conjunction with the Supply Function.

The Dispose Function's job is to save/store the contents of a node collection immediately before it is destroyed by the lead select change in the parent. Unlike the Supply Functions the Dispose Functions have to be defined programmatically and are called by the Web Dynpro runtime framework when the node has been changed by the user.

I hope this makes it clear.

Cheers-

Atul

Former Member
0 Kudos

hi,

thanks for your reply....

But can you please incite a code

ThatSAPGuy
Advisor
Advisor
0 Kudos

Pinki-

You have to create an inner class in your component controller which implements the IWDNodeCollectionDisposer interface. You will have to create a method called disposeElements() in this class which will hold the functionality to store your changes. i.e.


//@@begin others
private class Disposer implements IWDNodeCollectionDisposer {
	public void disposeElements(IWDNode node) {
		// put in your logic here
	}
}
//@@end 

Cheers-

Atul

Former Member
0 Kudos

Hi Pinki

In WebDynpro for Java before the WebDynpro component gets disposed it calls the wdDoExit method on each WebDynpro object in that component. In that method you could put code that "cleans" your usersession.

Regards

Göran