Hello,
I need some clarifications regarding the contexts in webdynpro developer Studio.
The method documentation says
/**
Root node of this controller's context. </p>
*
Provides typed access not only to the elements of the root node
but also to all nodes in the context (methods nodeXYZ()),
to their currently selected element (methods currentXYZElement())
and facilitates the creation of new elements for all nodes
(methods createXYZElement()). </p>
*
@see com.sap.suresh.test.wdp.IPrivateUser.IContextNode for more details.
*/
If I have a node called Orders....then
what is the difference between nodeOrders( ) and
currentOrdersElement( ) and
createOrdersElement( ).
I am really confused. Could anybody explain to me please.....
Thanks,
Suresh
Hi Folks,
I figured this out while playing in the NetWeaver Developer Studio. This concept is simple.
1. Assume Orders in my previous posting is the Internal Table returned by the Function Module(using Java Proxy).
2. We have to create Context Model node refering to the the class for the Orders table generated by the proxy in the Controller Context.
3. If you want to refer to the node in the context then address using nodeOrders().
4. Since the Internal table could have many records in it, each record is considered as an element(instance) for the Orders , the current instance is addressed with currentOrdersElement( ). then use getter and setter methods to get the value or set the value for the attribute for that instance which will affect the corresponding field of the record in the internal table. The records can be selected using leadSelect method.
5. If new data record need to added then create an instance of Orders and fill the values in the attributes, then use createOrdersElement( ) and supply the orders instance just created .
Hope this helps......if any questions I will be happy to help.
Suresh
Add a comment