Skip to Content
author's profile photo
Former Member

WebDynpro Context

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Oct 23, 2003 at 05:11 PM

    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 comment
    10|10000 characters needed characters exceeded

    • Hallo Suresh,

      you got the picture. In this context I want to point out the existance of a Web Dynpro Tutorial called 'Application of Context Programming and Data Binding' (Master-Detail-Viewer for Customers and Orders). You can have a look at this tutorial by opening the SAP NetWeaver Help (node SAP Web AS for Web Applications - Development Manual - Developing Web Applications - Web Dynpro - Tutorials for Web Dynpro Applications - Application of Context Programming and Data Binding).

      There you can find detailed informations (illustrated by charts) about how to understand the concepts of controller contexts (declaration at designtime, context at runtime), terminology (value nodes, node collection, cardinality, node elements, lead selection, supply functions) or the related context-API for programmatically filling contexts with data etc. The tutorial is based on value nodes, not model nodes.

      Best wishes,

      Bertram Ganz, Web Dynpro team