cancel
Showing results for 
Search instead for 
Did you mean: 

JavaBean methods not visible

former_member212767
Participant
0 Kudos

Hi,

I created a JavaBean with properties, getters and setters and a few other methods (addRecord, deleteRecord etc.). I'm using this bean to insert & update data on a Oracle database.

I created a model from this JavaBean, added it to used models and did the context mapping.

I can see the getters and setters fine, but the other methods do not show up.

What should I do to get these methods visible to WebDynpro ? Should these methods be of certain type or should I add them somwhere (to methods in the JavaBean model in dev studio maybe ?) to be visible ?

Any help greatly appreciated!

Kind Regards,

Jari Pakarinen

Message was edited by: Jari Pakarinen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

After import JavaBean model and connecting in data modeler, try applay model to view. It's work fine.

In controller you can bind that model puting code in controller wdDoInit()


try {
  MyObject myobject= new MyObject();
  myobject.callSomeMethod();
  wdContext.nodeMyNode().bind(myobject);
  } catch (Exception e) {}

When you want to call some method, make action and in action method put


   wdContext.currentMyObjectElement().modelObject().callMethodFromMyObject();
   wdContext.nodeMyNode().bind(wdContext.currentMyObjectElement().modelObject());

I hope it will help you.

Regard

Vedran

former_member212767
Participant
0 Kudos

Hi,

Thanks!

wdContext.currentMyObjectElement().modelObject(). etc

was the part i was missing. Thank you!

Regards,

Jari

former_member212767
Participant
0 Kudos

I would give you points but I don't see any option to do it... only an option "solved it on my own".

Jari

Former Member
0 Kudos

Click on Verdan's post and you should see more options. Also make sure that you select "Mark this post as question..." on your first post in this thread.

VS

former_member212767
Participant
0 Kudos

Hi,

Yes, it was marked as a question when I started the thread. Still no options for points...

Jari

Former Member
0 Kudos

No problem,

you will buy me a beer when we meet on some SAP event ).

And thanks Valery on your effort.

former_member212767
Participant
0 Kudos

It's a deal

Jari

former_member212767
Participant
0 Kudos

Hi again

Should I just use the JavaBean straigth from the view of component controller and leave the model thingy out of the picture ?

What are the pros/cons here ?

Regards,

Jari