cancel
Showing results for 
Search instead for 
Did you mean: 

public static method

Former Member
0 Kudos

Hi,

I want to create a method of my own and i want to call this method in wdDoModifyView().

I want the method to be of public static type.

I ve written the method in the "others" as

public static void myMethod(){

//code

//code

}

I want to write a print statement in this method so that i can make sure that this method is getting called in the wdDoModifyView().Can anyone tell me how to proceed?

Regards,

Padmalatha.K

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

No need to make it public. Just declare the parameters you need to pass from wdDoModifyView() in that method.

Armin

Former Member
0 Kudos

HI Armin,

Thank you for your reply.

Can you please give me a small example i,e

How do I write the method with parameter and how do I call them in the wdDoModifyVew.

Example will be very helpful for me.

Regards

-Padma K

Former Member
0 Kudos

Hi Padma,

You can declare the method as you declare in normal java programming.

Method Declaration:

myMethod(String name)

{

// Cpde

}

Calling the method:

myMethod("name");

Thanks n Regards,

Jhansi Miryala

Former Member
0 Kudos

static void myMethod()

{

//code

}

public static void wdDoModifyView(parameters)

{

myMethod();

}

Former Member
0 Kudos

public static void wdDoModifyView
(
  IPrivate<View> wdThis, 
  IPrivate<View>.IContextNode wdContext, 
  com.sap.tc.webdynpro.progmodel.api.IWDView view, 
  boolean firstTime
)
{
  myMethod(wdThis, wdContext, view);
}


//@@begin others
private static void myMethod
(
  IPrivate<View> wdThis, 
  IPrivate<View>.IContextNode wdContext, 
  com.sap.tc.webdynpro.progmodel.api.IWDView view
)
{
  ...
}
//@@end

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

ThanQ for the replies.............

But i want to write a print statement so that i can make sure that this method is getting called in wdDoModifyView()

Just as we write..........

wdComponentAPI.getMessageManager.reportSuccess("Success"); in wdDoInit() method

or

IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();

msgMgr.reportSuccess("Success"); in wdDoModifyView().

How should i write the print statement in myMethod() in "Others" . I tried with System.out.println("Success");. It is not working.

Please suggest me.

Regards,

Padmalatha.K

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Padma,

In WebDynpro we have to show the message using WDMessageManager API.

WDMessageManager msgmgr=WDComponentAPI.GetMessageManager();

msgmgr.reportsuccess(" Inside the my data method"); or

wdComponentAPI.getMessageManager().reportSuccess(" Inside the my data method");

Regards, Suresh KB