cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching a view to ViewElementUIContainer at runtime

Former Member
0 Kudos

Hello All,

I tried to use ViewElementUIContainers for arranging my views in row. I can do this at design time. But in my scenario i have 1 <b>ParentView</b> having 3 ViewElementUIContainers <b>VEUIContainer1,VEUIContainer2,VEUIContainer3</b>. I have assigned 1 view each to <b>VEUIContainer1 (StaticView1)</b> & <b>VEUIContainer2 (StaticView2)</b> but to <b>VEUIContainer3</b> i want to assign one of the two other <b>(DynView1 & DynView2)</b> views dynamically.

Can this be done?

Regards,

Aayush

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Create 4 ViewContainer elements .

Assign each view to each container element...

Set the visibile property appropriately to select three of them !

Former Member
0 Kudos

Hello Bharathwaj,

Thanks.

Should i attach <b>VEUIContainer3</b> to <b>DynView1</b> and . After doing it in <b>wdDoInit</b> method of my <b>ParentView</b> i can get the handle of <b>VEUIContainer3</b> as

IWDViewContainerUIElement viewContainer= (IWDViewContainerUIElement)view.getElement("VEUIContainer3");
 

Now how to make <b>DynView1</b> visible or invisible ? Can you give some code example?

Regards,

Aayush

Former Member
0 Kudos

Hi,

Create two value attributes of type com.sap.ide.uielementdefinitions.Visibilty and map each of them to the visible property of the ViewContainer UI .

Now in the code in the appropriate location ,access the setter method of the attribute and give

say....

set<vale attrname>(WDVisibility.VISIBLE) OR
set<vale attrname>(WDVisibility.NONE)

Regards

Bharathwaj

Former Member
0 Kudos

Hello Bharathwaj,

I solved it by hit and trial. I did it the same way as you suggested.

Regards,

Aayush

Answers (0)