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
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 a comment