cancel
Showing results for 
Search instead for 
Did you mean: 

access Variables of attributes TAB in WDComponent

Former Member
0 Kudos

Hi All,

Can anyone explain how to access Variables of attributes TAB of component controller and view .

1)I have declared variable

g_werks1 in component controller attributes tab 

g_werks2 in view  attributes tab .

can I use g_werks1 and g_werks2 any where in my compoent.

2)can we change the content of the g_werks1 and g_werks2 ?.

Please provide me some example how use them.

I gave a try as below

in component controller methods

g_werks1 = '123'.

in view methods

WD_COMP_CONTROLLER->g_werks1 = '123'.

g_werks2 = '123' w.r.t View

its throwing error “Field "G_WERKS" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement."

Thanks

Gopal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gopal,

To use attributes you have to use instanse variable of the component controller or view.

In your component controller attributes tab you will have,

wd_this which is referring to if_component_controller. This reference variable you can use in anywhere in component provided its Public property is checked.

if you are using at  component level -> use like wd_this->g_werks1.

If you want to use the same in view level -> use wd_comp_controller->g_werks1. beacuse view will have comp controller instance.

You can not use views variables inside component controller.

Similarly views variable you can use as wd_this->g_werks2.


Regards,
Ravikiran.K

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

To access view attributes in view( or component controller attributes in component controller) use

wd_this->attr_name.

To access component controller attributes in view use, wd_comp_controller->attr_name.

You have to make that attribute public visibility. Select the public check box for that attribute( as shown below) in component controller to access it out side.

Hope this helps u,

Regards,

Kiran