on 05-03-2010 12:26 PM
Hi,
I want to declare some global attributes for Component Controller and initialize them in WdDoInit() method.
I have declared them under Component Controller --> Attributes tab --> after wd_context and wd_this (say G_MESSAGE).
However, when I am trying to set them in wdDoInit() method, I get compilation error saying G_MYMESSAGE is unknown and its not defined using data statement.
How do I access these attributes?
Thanks and regards,
Amey
Hi,
Mark the Global attribute G_MESSAGE as public. Also when you are going to access it in Component controller you can get it by using wd_this->G_MESSAGE and in View controller as wd_comp_controller->G_MESSAGE.
Hope it Works for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Amey,
You need to access the variable by "wd_this->g_mymessage"
Since wd_this attribute in each controller refers to interface of local controller. you could read the description of that attribute in attribute tab.
Regards
Anurag Chopra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good advice already on how to access. One other tip. After creating the attributes active the component before you write any code that accesses the global attributes. This will generate the dynamic classes behind the scenes and help ensure proper access (if all other suggestions fail).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.