Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Destroying Dynamically created ui elements

Hi All,

We are generating labels at runtime in doModify method ,when view is loaded.

(we are able to do this)

IWDLabel Label = (IWDLabel)view.createElement

IWDLabel.class, "Label" );

There is button in a view .

Requirment is to replace labels in the same container on click of button.

but before replacing labels we have to remove initially generated labels from container .

We are using followin code to remove elements from the container

container.removeAllChildren();

container.destroyAllChildren();

After this When we are regenerating labels on click of button

it gives an exception

+Cannot add element with duplicate ID "Label" of type com.sap.tc.webdynpro.clientserver.uielib.standard.impl.TextView

+

Please let us know the solutions.

Thanks;

Zaid

Former Member
Former Member replied

Just give the labels you are creating different IDs. This can be achieved for example by passing NULL as ID.

Armin

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question