cancel
Showing results for 
Search instead for 
Did you mean: 

Binding model nodes - seeming repetition?

Former Member
0 Kudos

Hello,

When creating a WD app using Adaptive RFC Model (or any model I assume), it is necessary to create a data link between the Model and Component Controller. Visually, the fields of the nodes of the Model and the fields of the model nodes of the Controller are linked. Why, then, is it necessary to again bind the model node of the Controller to the model object using the ".bind" method?

Code as shown here is a classic example:


	Bapi_Usr01Dohr_Getemployee_Input bapiInput = new Bapi_Usr01Dohr_Getemployee_Input();
	wdContext.nodeBapi_Usr01Dohr_Getemployee_Input().bind(bapiInput);
	bapiInput.setId("MY_USERID");
	try {
		bapiInput.execute();
	} catch (Exception exc) {
		IWDMessageManager msgManager = wdComponentAPI.getMessageManager();
		msgManager.raiseException(exc.getMessage(), true);
	}

Clearly the visual binding in the diagram view of the component controller and the programmatic binding using the .bind method of the model node are doing different things. My question is, what is the difference? Why are both required?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Michael,

There are actually 3 activity types, and sadly one of them has not the best name:

1. Map at run-time / design-time model to context node (make metadata structure, that mimics model structure, possibly with renaming of target attributes / sub-nodes)

2. Map at run-time / design-time (or as you say "link") 2 nodes in different controllers (make metadata structure, that mimics structure of node's metadata in another controller, possibly with renaming of target attributes / sub-nodes)

3. "Bind" at run-time-only data to node, that was previously described as metadata either using IDE at design-time or at run-time.

So, there is no repetition: you create metadata once (ok, more logically "once" then physically), then you may assign different data to resulted node via bind several times.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Michael,

As per my understanding

Model Binding between Model and Controller defines the data flow between the Web Dynpro model and the processing Web Dynpro application.

What we do in the code you wrote is to create the instance of the Model Class and attach this instance to the Node so that we can use the same.

Hope this helps.

Regards,

Shubham