cancel
Showing results for 
Search instead for 
Did you mean: 

import JavaBean Model: no executable Methods?

Former Member
0 Kudos

Hello everybody,

after a long time we ware proud to import a JAVABEAN Model to WebDynpro. We wonder why we do not see any executable methods after import.

Could anybody please send a working sample?

What are the requirements for the JAVA classes to be imported?

We have some properties with setter and getter methods. Additionally we have some methods for reading information out of the database. What are the requirements for these methods?

Thanks a lot

Regard Mario

Accepted Solutions (0)

Answers (1)

Answers (1)

florian_speth
Explorer
0 Kudos

Hi Mario,

unfortunately, for the Java Bean Mode, the "Apply Service Controller"-Template does not work. You need to do the required steps manually:

After importing the Java Bean Model, you need to create a link between the Component Controller and the model (take care to bind the nodes as well).

In the wdDoInit() method, you need to bind the CommandBean-Class to the Context:

wdContext.node<beanName>().bind(new <beanName>());

At last, you should create a execute() method in the controller (go to tab "Methods"-->new). Add the following code to the method body:

wdContext.current<beanName>Element().modelObject().execute<XY>();

Requirements for the CommandBean-Class are (as far as I know):

-public constructor with no parameters

-private attributes with (at least) public getters

-take care about "throws XYException" (at least when you import the model, afterwards, methods can throw exceptions -> that's my experience)

-I remember that not all Java-classes are possible as return type...

Hope this helps.

Regards,

Florian