cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: declaring classes, methods, objects

former_member196601
Active Participant
0 Kudos

Hi,

Can anyone help me on how do i declare classes and methods in webdynpro. My requirement is to do some functionality in a method of a class and reuse the code wherever i require.

Can anyone help me on this?

Thanks

Regards

Naveen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Naveen George ,

You can create methods in both component controller and on each view also.

methods dexlaring in comp controller will be common among all view

you can call comp controller method like comp_controller->method name in other view

and own methods can be called like wd_this-> method name.

you can also use wizard to call methods

for calling own methods you have to select current controller radio button and for comp_controller you hacve to use used controller.

you can create method by going to method tab both in view and component controller

Regards

Sarath

Answers (2)

Answers (2)

former_member182190
Active Participant
0 Kudos

Hi Naveen,

To make a method available across two or more views rather all the views it should

be declared in the Component Controller as the methods and attributes of Component

controller are global across the Webdynpro component.

If you have a specific requirement where you have already declared a method

and need to use it in another view, you can create a interface method in the

Component controller and call the specific method inside it.

Then call this Interface method in the second view.

Hope this solves your doubts.

Regards,

Ismail.

Former Member
0 Kudos

hi naveen.....

go to methods tab....

create a method in it....

and you can call the method from any part of the coding in any other method.

---regards,

alex b justin

former_member196601
Active Participant
0 Kudos

Hi Alex,

I believe Its not possible to call that method in any other view.

Suppose i have 2 views, in the first view i have declared the method as u have said and if i need to use it in the second view, how do i proceed?

Can u explain with a sample code.

Regards

Naveen