cancel
Showing results for 
Search instead for 
Did you mean: 

How to reuse UI elements in view design

Former Member
0 Kudos

Hello

How can I reuse UI elements when designing a view?

For example: I built a UI container (TransparentContainer) consisting of a FormattedTextEdit, some buttons and other UI Elements. This container will be used in several views and even several times inside the same view.

The solution which I use at the moment is to copy/paste this UI container. But this is a bad solution, because if something in the container has to be changed, it is very cumbersome to adapt also all copied instances.

I also tried to put my UI container into a separate view and than to reuse this view in other views by means of the ViewContainerUIElement. But this does not work if the UI container has to be placed more than once inside a view, as duplicate usage of a view raises a WDRuntimeException.

What is the best way do reuse several UI Elements in desinging a view?

Greetings

Rolf

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Still open question:

Solution for TabStrip?

Former Member
0 Kudos

Hi,

It is not possible to achieve using TabStrip.

Becuase in TabStrip every tab will have tab content area(container). When you click on any tab by default that tab content area will be displayed. So whatever UI elements you want to show as part of that Tab selection you should keep them in that tab content area.

As you said using radio button soluction you can achieve this.

Regards,

Charan

Answers (4)

Answers (4)

Former Member
0 Kudos

There are several possibilities like creating a separate WD component that provides the common view or by implementing the common view by code.

Armin

Former Member
0 Kudos

Ok, thank you for the helpful answers.

Former Member
0 Kudos

Thank you Rajat for your answer.

Is there any solution to solve this problem for the "Tabstrip"?

Thus, let's say I have a "Tabstrip" with 10 "Tabs". All the tabs have the same UI elements only the data of the UI Elements changes among the tabs. Do I really have to copy my UI elements 10 times?

Of course, another solution would be to "simulate" the Tabstrip with some radio-buttons and one container that shows the content of the selected tab/radiobutton.

Former Member
0 Kudos

Hi Rolf,

I do not think it is possible to use the UI elements the way you are wishing to. Actually to reuse the ui element, the approach is already known to you, i.e., to copy and paste the container from 1 view to other.

Regards.

Rajat