Updated TemplateController::handlePut() to delete existing child widgets before creating new ones.