Hi,
what is the best practice to prevent the following error:
The pseudo code that leads to this situation is as follows:
- Create a HLayout and add it to the screen.
- Create and add several other widget to this HLayout
Manually assign these other widgets (Buttons, dynamicforms, listgrid) own, static IDs like listgrid.setID("myListgrid");
- Let the user interact with the screen
- later on remove the HLayout from the screen by invoking removeMember(myHLayout)
- destroy even the class instance that created these elements to be sure, that are no references any more
- No try to recreate the HLayout and the child widgets with exactly the same IDs as above.
You will get errors in the log like the one on top of this post that complain, that components with these IDs are already there.
Now the question is: What exactly triggers the destruction of objects so that their IDs are free again?
Note that in my example even the class instance that created the widgets is destroyed.
But it still does not work. Do I have some other reference there to the objects which prevent their destruction? How can I check for that?
I need the exact IDs for my selenium test cases where I need exactly the same IDs for each test iteration to allocate the controls in the selectors appropriately.
Thanks in advance,
Andre
what is the best practice to prevent the following error:
Code:
Specified ID:MyObjectID collides with the ID for an existing SmartGWT component or object.
- Create a HLayout and add it to the screen.
- Create and add several other widget to this HLayout
Manually assign these other widgets (Buttons, dynamicforms, listgrid) own, static IDs like listgrid.setID("myListgrid");
- Let the user interact with the screen
- later on remove the HLayout from the screen by invoking removeMember(myHLayout)
- destroy even the class instance that created these elements to be sure, that are no references any more
- No try to recreate the HLayout and the child widgets with exactly the same IDs as above.
You will get errors in the log like the one on top of this post that complain, that components with these IDs are already there.
Now the question is: What exactly triggers the destruction of objects so that their IDs are free again?
Note that in my example even the class instance that created the widgets is destroyed.
But it still does not work. Do I have some other reference there to the objects which prevent their destruction? How can I check for that?
I need the exact IDs for my selenium test cases where I need exactly the same IDs for each test iteration to allocate the controls in the selectors appropriately.
Thanks in advance,
Andre
Comment