cancel
Showing results for 
Search instead for 
Did you mean: 

which Windows for the same view

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Valery,

The view will be embedded in different windows, so there is <b>no need</b> to include same view twice in view assembly.

Do you have any other suggestion?

Thanks,

-Tony

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Tony,

If you want different texts then i would suggest to create altogether a new view and embed into that window.

Regards, Anilkumar