cancel
Showing results for 
Search instead for 
Did you mean: 

how to overload methods?

Former Member
0 Kudos

Hi,

I want to have a method in an interface controller which may be called with one or two parameters. How can I do this in WD, the designer won't let me define another method which already exists...

regards,

Markus

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hello,

AFAIK, it is impossible. Method name should be unique. Use different method names.

Regards, Maxim R.

Former Member
0 Kudos

Hi,

It seems not possible in web dynpro programming model.

As whenvever we create a method, Code generator first see if any method exists with the same name and that's why asks unique name.

Even if we choose a different name (with diffrent parameters) and later we try to Rename it after an existing method (with diffrerent parameters) using Refactor Menu, it works untill we "save".

Upon saving the source, method gets renamed to its original name. This is because Code generator invode wdInvokeEventHandler(String handlerName, IWDCustomEvent event) which throws NoSuchMethodException

that's why it ignore the change. (See this while renaming a method, and click preview).

Rgds,

Vilish

Former Member
0 Kudos

Well, I found out that it IS NOT possible! The reason for that is that Web Dynpro's metamodel is designed to be independent from any programming language. So WD should also be possible to use ABAB which doesn't support overloading. So WD can't use overloading either...

See "Inside Web Dynpro for Java" by Chris Whealy, page 264...

Answers (2)

Answers (2)

Former Member
0 Kudos

But that section has been defined to be an area not visible by other controller/views

Regards

Pran

Former Member
0 Kudos

I am not sure but try it in the area "begin others" that you would find at the bottom.