Skip to Content
0
Former Member
Feb 17, 2010 at 11:21 AM

Used WebDynpro Component

16 Views

Hello,

In a MainDC, There are 3 components in that. they are ComponentA ComponentB & ComponentUtil.

ComponentUtil is used component of both ComponentA & ComponentB. (property: createOnDemand)

I assume that For ComponentA, one object of ComponentUtil is created & used. And For ComponentB, another object of ComponentUtil is created. But i want only one & the same object of ComponentUtil be used in both ComponentA & ComponentB at runtime. How to achive that only one object of ComponentUtil be used in all other componets which are using this?

In CompUtil,

there is a value node called StudentNode and below 2 methods

1) First method -- addElementsToStudentsNode (inputFromOtherComponent_Studentnode) : input parameter node IWDNode. This method create StudentNode elements & set the vales with that of inputparameter elemnt & then add the element to the StudentNode.

2)Another method -- dsiplaySizeOfStudentNode() : To display the size of studentNode.

Functionallty (observe steps 3, 4, 5 & 6 carefully) :

step 1: intially From ComponentA, called dsiplaySizeOfStudentNode() of ComponentUtil -- size 0 (as expected)

step 2: ComponentB, called addElementsToStudentsNode() by passing the studentNode with 5 elements.

step 3: ComponentB, called dsiplaySizeOfStudentNode() of ComponentUtil -- size 5 (as expected)

step 4: From ComponentA, called addElementsToStudentsNode() by passing the studentNode with 3 elements.

step 5: ComponentA, called dsiplaySizeOfStudentNode() of ComponentUtil -- size 3 ( I am expecting 5+3, ie total 8 elements but the node contains only 3 latest elements which are added from ComponentA. Here i want to display 8 elements both added from ComponentA & ComponentB.)

step 6: ComponentB, called dsiplaySizeOfStudentNode() of ComponentUtil -- size 5

Observations:

For ComponentA, there is one ComponentUtil object created (this contain 3 elements) & For ComponentB another ComponentUtil object is created (contains 5 elements). But I want only one object of ComponentUtil be used both in ComponentA & ComponentB. so that i can display all (total) the elements added from ComponentA & ComponentB. According to me only one object of ComponentUtil should exsit & this object should be used in all other components which useses this ComponentUtil . How can i achieve this?

Thanks

Hussain