cancel
Showing results for 
Search instead for 
Did you mean: 

Aaccessing view elements in view coding

Former Member
0 Kudos

Hi all,

I want to access view element attributes in coding beyond the static wdDoModifyView method. This method has a paremeter "view" (type com.sap.tc.webdynpro.progmodel.api.IWDView) which gives me access to element attributes via view.getElement(<name>).

Is it possible to access this IWDView object in view coding outside of method wdDoModifyView?

Michael

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Michael,

You can store view variable in context BUT it is hardly recommended to avoid doing this - try to redisign your logic.

Best regards, Maksim Rashchynksi

Answers (1)

Answers (1)

Former Member
0 Kudos

Why?

Armin

former_member182372
Active Contributor
0 Kudos

Armin, isn`t it your opinion on this: :

<i>

No, this is bad advice. UI element instances should only be referenced in wdDoModifyView(). To change properties from event handlers, use data binding.

Armin

...........

Do not store the IWDView reference in the context for accessing UI elements from event handlers.

Armin

</i>

Former Member
0 Kudos

Hello Maksim,

you got me wrong. I asked "why" on the original posters question.

I wonder why he wants to access view elements for getting property values because he should use data binding for this.

Armin