cancel
Showing results for 
Search instead for 
Did you mean: 

removeElement

Former Member
0 Kudos

I got a question about removing an element (from a view context)which is mapped to an element (from the controller context).

Is it normal that the element in the controller context is removed too ??

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Frantz,

Yes, this is behavior by design: mapping is complete bi-directional link; changing / adding /removing are reflected in all elements participating in mapping.

VS

Former Member
0 Kudos

thank you valery,

is there a way to make an uni directional link ?

Regards,

Frantz

Former Member
0 Kudos

Frantz,

Just remove mapping and copy elements back and force when necessary. What could be simpler?

Hint: read about WDCopyService class.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

ok thank you but ...

there's one thing i don't understand about this blog :

/people/subramanian.venkateswaran2/blog/2005/05/10/filtering-table-values-using-webdynpro

this blog doesn't mentionned birectionnal mapping because he deleted elements from the context view witouht affecting the component controller context ...

i'm lost ...

Regards,

frantz

Former Member
0 Kudos

Frantz,

Everything ok with this blog, and statements there do not conflict with my statements.

When you are using mapping you are in fact has only one physical data collection -- original node. Mapped nodes are merely proxies around original node (that does not keep data on its own), so any changes are always up to date among all nodes participating in mapping.

When you use "copy" instead of mapping then data is stored in 2 places. So remove in one place does not cause remove in other one unless you write special code.

And, btw, here is a statement from the blog:

<i><b>Don’t do a context mapping of view context to component/custom controller</b> used to fetch data i.e. for task a) you have created a component/custom controller and you have bound it with the model. In this case don’t do a context mapping of this component/custom controller to view context. We will instead source data from component/custom controller and put it in the view context.</i>

So in fact in blog 2 nodes (non-mapped between each other) mentioned: first declared in custom controller, and it always contains all items; second declared in view controller and it contains only items that pass filter condition. View controller node is populated via copying of elements from custom controller node.

Valery Silaev

EPAM System

http://www.NetWeaverTeam.com

Former Member
0 Kudos

thank you very much valery !

It was my mistake !

Thank you

Regards,

Frantz