cancel
Showing results for 
Search instead for 
Did you mean: 

how to call Method from wdDoModifyView()

0 Kudos

Hi,

I have a private method and i wanna call this method from wdDoModifyView() hook method.

but when i call mthod it gives me error the method dim() from the type ..view is not static.

can any one tell me how can i access this method?

best regards

Yasir Noman

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Why do you need this call from within wdDoModifyView() at all? The purpose of wdDoModifyView() is to have a single place where the view may be accessed and manipulated. Is this really needed in your use case?

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Yasir,

i'm not sure what you mean with the "dim()" method. I guess this is the non-static method you want to call from wdDoModifyView()? You should already get a compile-time error, not only a runtime error.

The reason is simple: There is <b>no</b> possibility to call non-static methods from a static context. Static methods "belong to" a class while non-static methods "belong to" instances of a class.

A simple alternative is to declare dim() as public using the "Methods" tab of the corresponding view controller and use the "wdThis" reference you are getting as a parameter of the wdDoModifyView() method such as you can call wdThis.dim().

It's <b>not</b> sufficient just to change the method to public inside the //@others section, since wdThis will not know the method then since it's not part of the controller metadata.

Hope that helps.

Regards

Stefan