cancel
Showing results for 
Search instead for 
Did you mean: 

how to get a "com.sap.tc.webdynpro.progmodel.api.IWDView" object

Former Member
0 Kudos

hi,everybody,

As we all know, there is a com.sap.tc.webdynpro.progmodel.api.IWDView object in wdDoModifyView() parameters.We can use the IWDView object in the method or after the method.But in my project, I want to use the IWDView object before wdDoModifyView() method.I don't know how to create a IWDView object. Would you please help me.Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

This is not recommended to access the view outside the modifyView . what exactly is ur requirement & why u want to use that before wdDoModifyView ? Its controlled by wd Framework & i don't think u can access it explicitly.

regards

Sumit

Former Member
0 Kudos

hi,Malhotra

Thank you for helping me. In my project, I want to use the IWDView object in the onPlugxxxPlugIn() method. But I find that onPlugxxxPlugIn() is executed before wdDoModifyView() method.So I can not use the IWDView object which is in wdDoModifyView() method. So I think I must create a new IWDView object.

Former Member
0 Kudos

Hi daniel,

wdModifyView is called by framework while rendering the view & IWDView is used for it. Before wdDoModifyView its not possible according to me , may be u can check with armin.

Hi Manoj,

First of all, even if u declare a variable , u can't initializae it before weDoModifyView. Apart from that its always suggested , not to access the IWDView outside the wdModifyView . i think that's why wdDoModifyView is static & called everytime ,u do anything with the view.

regards

Sumit

Former Member
0 Kudos

The view instance should only be used to modify the view and only in the dedicated hook method wdDoModifyView(). Why do you need the view elsewhere?

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You declare a variable of IWDView as below in the others section:

//@@begin others

public static IWDView viewObj;

//@@end

And in wdModifyView() add:

viewObj = view;

Thats it. Now you can access it anywhere.

thanks & regards,

Manoj

Former Member
0 Kudos

That's only good to break your application (think about what "static" means).

Armin