cancel
Showing results for 
Search instead for 
Did you mean: 

Copy View elements dynamically

Former Member
0 Kudos

HI,

I want to know if it's possible to copy ui elements at runtime. For example, I have transparent container with various settings for width, height and so on. At runtime, I want to make a new Transparent Container with the same settings as a Transparent Container already in the view. Is there some function to make a copy of a view element? Or do I have to set each setting for the new transparent container?

Best regards,

Peter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Peter,

There is no feature to copy the settings of a UI element to create a new one at runtime. You will have to specify the properties one by one.

Regards,

Shyam.

Former Member
0 Kudos

Ok,

thanks for your answer.

Bad news for me

Answers (1)

Answers (1)

Former Member
0 Kudos

Code in wdDoModifyView. I have not tested the code though. I hope it works!


   // get reference of the tc to copy
   IWDTransparentContainer source = (IWDTransparentContainer)view.getElement("TransparentContainerToCopy");
   // create a new tc
   IWDTransparentContainer target = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"TransparentContainerCopied");
   // use copy corresponding
   WDCopyService.copyCorresponding(source,target);
   // add newly created tc to view
   ...... 
 

Former Member
0 Kudos

I have tried this code, but it does not seem to work.

Best regards,

Peter