Skip to Content
0
Former Member
Oct 05, 2008 at 09:15 AM

Destroying Dynamically created ui elements

35 Views

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