on 10-05-2008 10:15 AM
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
Just give the labels you are creating different IDs. This can be achieved for example by passing NULL as ID.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have to use below code to remove the elements
view.getElement("Lable0").destroy();
instead of
container.removeAllChildren();
container.destroyAllChildren();
I hope it solve your problem
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have to just recreate a part of view , and only this part has dynamic part.
by view.reset() will it be fine in this case ???
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for reply, but i need to create the elements with NAME
Here we create this label multiple times in for loop.
IWDLabel Label = (IWDLabel)view.createElement
IWDLabel.class, "Label"+i );
and we need to recreate these labels again.
Hence i did destroyAllChildren and removeAllChildren, as given earlier.
Yet it gives me this exception when i recreate after this.
is there something i am missing or even on Destroy and Remove methods being called, the name still exists ????
thanks and regards;
ZAID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.