on 07-14-2005 10:38 AM
Hi everbody,
I have a really simple question:
how can I access UI elements of a view in onAction methods so that I can change their attributes?
(In the wdModifyView method I had no problem because I got access by the IWDView parameter).
Regards,
Christian
Hi Christian ,
You can do this by Context programming.
Create a Context Attrib of type "IWDView" and intialize this attrib in wdModifyView.
Use this ContextAttrib in any "onActionXXX" to get the UIElements.
Ex : wdContext.currentContextElement().getView().getElement("ID");
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Anilkmar wrote:
"You can do this by Context programming.
Create a Context Attrib of type "IWDView" and intialize this attrib in wdModifyView."
How do I create an Element of type IWDView?
do you do that in implementation in doModify?
The point is, I need to create TextViews dynamically, depending on incoming xml-files.
thanx for a hint.
To dynamically create view parts from configuration data, for example from RSS XML files, add a change-flag to the view context indicating that new configuration data are available.
In wdDoModifyView(), check this flag and recreate the view parts as needed, reset the change-flag afterwards.
Do not store the IWDView reference in the context for accessing UI elements from event handlers.
Armin
Thank you all for your answers. I finally solved it by the way Armin proposed.
Best Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Why do you need it outside ? You are not supposed to access it outside the wdDoModifyView.
It is not advisable to copy the UL object or store and then access it.
what you can do is write the code in modify view inside a if condition and change the condition depending on the requirement.
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cristian,
Yes you can achieve by the way Anil has described.
What else you can do is, make context attribute related to the property of the UI element instead of saving whole view object in context.
Like, if you want to change visibility property of any UI element then, make one context attribute of type VISIBILITY and then onActionXXX method alter the value of this context attribute as you required.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.