cancel
Showing results for 
Search instead for 
Did you mean: 

How to tranfer Object Model beetwen two elements?

Former Member
0 Kudos

I need move a Model Object from one IWDNodeElement, to other IWDNodeElement.

Both elements are the same type.

I try with this code, but for some reason doesn't work always.


	public void applyInputValues(IWDNodeElement applicationNodeElement, IWDNodeElement queryInputNodeElement) {
		IWDNode node = queryInputNodeElement.node();
		node.invalidate();
		node.addElement(node.createElement(applicationNodeElement.model()));
	}

Accepted Solutions (1)

Accepted Solutions (1)

former_member201361
Active Contributor
0 Kudos

Hi Sebestain,

from the method signature, i beleive that u are implementing Object value selector(OVS).

and no need to copy the data from the applicationNodeElement to QueryInputNodeElement, as they are pointing to the same node(QUERY Node which u have bind to the Value help search input field).

if i am wrong, please elaborate your query.

Thanks and Regards

Former Member
0 Kudos

@Fazal Ahamed

I create a Generic OVS, with some metadata (labels + columns's name + input's names + model class). I build a dinamic context only for the OVS. For this reason I need to keep separate OVSNode and ApplicationNode.

I'll try with WDCopyService.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

WDCopyService.copyElements(sourcenode,targetnode);

Thanks,

Tulasi

former_member197348
Active Contributor
0 Kudos

Hi,

Did you try wdCopyService API?

wdCopyService.copyElements(source, target);

Please note: You will get WDRuntimeException - if target is a model node and source is not a model node holding the same class.

invalidate() works for only for value nodes. If you want to clear the model node you can try like this:

wdContext.current<rfc>_InputElement().modelObject().get<node>().clear();

Regards,

Siva

Edited by: Siva Rama Krushna on Jan 7, 2009 2:59 PM