Skip to Content
avatar image
Former Member

Obtaining a reference to EJBs building the WD Model

Hi All,

does anybody know how can I easily obtain a references to the EJBs that build the WebDynpro model. For example when I select something in some tree automatically the context element is selected but I want to call some method of the EJB that is associated to this context element.

Any ideas?

Metodi

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Dec 12, 2003 at 05:53 PM

    Hi Metodi,

    You get the original EJB that is bound to the model node as follows: get the model node, from the node a concrete element, and then the API on the element provides the method modelObject() that returns the EJB instance bound to the element.

    Example:

    You have an EJBb of type MyEjb, a model node in your context with name "MyEjbModel", and you have bound an instance of MyEjb to the node. Then you can get the model class instance as follows:

    MyEjb ejb = wdContext.nodeMyEjbModel().currentContextElement().modelObject();

    Best regards,

    Karin

    Add comment
    10|10000 characters needed characters exceeded