on 01-31-2007 11:32 PM
I have the <b>same view</b> embedded in <b>two windows</b>, and in the view I need to know which window it's embedded so I can put different texts for the buttons in the view. Is there any way I can figure out which windows the view is running from at <b>runtime</b>?
Thanks,
-Tony
Tony,
You may exploit WD limitation: any given view of component may have only one simualtenous visible instance, i.e. it's impossible to include same view twice in view assembly.
So, do the following:
1. In component controller context create some value node (cardinality 1..1, selection 1..1) + string attributes like ButtonTextA, ButtonTextB etc
2. In view add usage of component controller, then create node mapped to this component controller node. Bind button captions to corresponding attributes.
3. In interface view controller of every window add usage of component controller, then in wdDoInit of interface view controller access node with texts and set necessary values:
wdThis.wdGet<ComponentName>Controller().wdContext()
.currentButtonTextsElement().setButtonTextA("Command A");
(in code above use either wdContext() or getContext() -- I'm not sure what is correct)
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tony,
Do it dynamically.
Here i have a suggetion.
-Create a context element and assign it to the Button text property.
-Initailise the text with default visible view's button text.
-When you are calling the other window change the context to your requiremet.
I think this can solve your problem .
Thanks,
Sanjeev
Hi Tony,
If you want different texts then i would suggest to create altogether a new view and embed into that window.
Regards, Anilkumar
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.