cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to change the component controller attribute value dynamically ?

Former Member
0 Kudos


Hi Gurus,

in my wd component , in the componebt controller i have 1 attribute name lv_guid.

in my componet 4 view are designed along with 4 buttons(each view 1 button is allocated).

let us take lv_guid = "00012345".

if i click on view 1 = button 1,in action i need to change the value of lv_guid to "000678".

my question is  : am i update the value of lv_guid(new value) in the component controller attribute i.e lv_guid.

i want to use the new lv_guid in another view action method.

2. when we write the code in the component controller methods why not in view level methods.what is the major difference between the two scenarios.

Any ideas on this.

Regards,

Sudheer.

Accepted Solutions (0)

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Sudheer,

You can access component controller attribute in any views within component as below

     wd_comp_controller->lv_guid

Make sure that lv_guid attribute is set as PUBLIC in component controller.

Sample:

on click of button1 in view 1

     wd_comp_controller->lv_guid = '000678'.

on click of button 2 in view 2

     wd_comp_controller->lv_guid = '000679'.

    

Whenever there is a common logic to be used by all views, we create a method in component controller and can be used in any view

If any logic is for only particular view, then we create method in view

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Rama ,

Thanks for your quick reply ,

let us take lv_guid = '00678'.(globally)

in my view1 it is changed to lv_guid = '123'...

is this lv_guid(new value = 123) is globally is updated /available in component controller.

We can access this via wd_comp_controller.

for view 4  lv_guid will be '123' as per my requirment .

Is it updated globally.

Regards,

Sudheer

ramakrishnappa
Active Contributor
0 Kudos

Yes, it is updated globally within the component and updated value is available for all views.

Regards,

Rama