Clear AW Controls from Container

For example, I have a container control like this and one input control to accept the name. Based on the name, I create dynamic objects and associate to container.
var container = new AW.HTML.SPAN;

var obj_label = new AW.UI.Label;

var obj_input = new AW.UI.Input;

I put all the dynamic AW object controls inside an array and associate with the container:
var contents = [obj1_input, obj2_input, obj3_label, ....]; //obj2_input, obj3_label objects are dynamically created with ids are same as object name.
container.element().innerHTML = contents.join("");

When user tries to change the input (enters some other data, while the objects in the current page is displayed), I clear the contents array and display a fresh page
contents = [];
container.element().innerHTML = contents.join("");
After I clear the array, I associate new objects to the container and contents.

But when I try to get the id, of previous object, I am able to get, even after clearing the contents. I think, I still am not removing the object completely, but only from the array.
var tmp_obj_id = AW.object('obj1_input');
if(tmp_obj_id != undefined){

Is there to completely remove the old objects and its id?

I appreciate your response on this

July 15,
AW keeps internal reference to all objects with assigned id. This is how AW.object(id) works. The reference is located in AW.all array. To remove this reference assign null to AW.all[id].

AW.all[id] = null;
Alex (ActiveWidgets)
July 15,
Wow! This is cool.
Thanks a lot Alex for helping me on this. It now works great. It now clears the old object references.

July 15,

This topic is archived.

See also:

Back to support forum