Showing results for 
Search instead for 
Did you mean: 

Destroying Dynamically created ui elements

Former Member
0 Kudos

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



After this When we are regenerating labels on click of button

it gives an exception

+Cannot add element with duplicate ID "Label" of type


Please let us know the solutions.



View Entire Topic
Former Member
0 Kudos

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