This example shows how to use the GeoExt.component.Map class.
GeoExt.component.Map
Have a look at map.js to see how this is done.